/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here var dialog = new System.Windows.Forms.OpenFileDialog(); dialog.Filter = "Map file|*.js"; var result = dialog.ShowDialog(); if (result != System.Windows.Forms.DialogResult.OK) { Environment.Exit(0); } map = new Map(this); map.setMapFolder(dialog.FileName.Replace(dialog.SafeFileName, "")); map.LoadMap(dialog.SafeFileName); //shows the windows.forms layout design new Layout(map).Show(); //allows the mouse to show over the game this.IsMouseVisible = true; base.Initialize(); }
public Layout(Map map) { this.map = map; InitializeComponent(); }
public void DrawForOverworld(SpriteBatch spriteBatch, Map map, int x, int y) { if (texture != null) spriteBatch.Draw(texture, new Vector2(x + xPos * map.TileSize, y + yPos * map.TileSize), Color.White); }
/// <summary> /// Constructor to set the current map /// </summary> /// <param name="map">map object to set to current map</param> public FlagControl(Map map) { this.map = map; InitializeComponent(); }