Time for action – updating Game1
Double-click on the
Game1.vb
file in the Level Editor project to open it in the editor.Add the following declarations to the
Game1
declarations area:Public DrawLayer As Integer = 0 Public DrawTile As Integer = 0 Public EditingCode As Boolean = False Public CurrentCodeValue As String = "" Public HoverCodeValue As String = "" Public lastMouseState As MouseState Private vscroll As System.Windows.Forms.VScrollBar Private hscroll As System.Windows.Forms.HScrollBar
Add the following lines to the
Game1
constructor:vscroll = CType(parentForm.Controls("VScrollBar1"),System.Windows.Forms.VScrollBar) hscroll =CType(parentForm.Controls("HScrollBar1"),System.Windows.Forms.HScrollBar)
Modify the
LoadContent()
method of theGame1
class to read:Protected Overrides Sub LoadContent() spriteBatch = new SpriteBatch(GraphicsDevice) Camera.ViewPortWidth = pictureBox.Width Camera.ViewPortHeight = pictureBox.Height Camera.WorldRectangle =New Rectangle( 0, 0...