public void Init(string mapname, Game1 game, GraphicsDeviceManager man, string layer, string obj) { parent = game; g = man; map = Map.Load(Path.Combine(game.Content.RootDirectory, mapname), game.Content); cameraObject = map.ObjectGroups[layer].Objects[obj]; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); map = Map.Load(Path.Combine(Content.RootDirectory, "center.tmx"), Content); map.ObjectGroups["4Events"].Objects["Spawn"].Texture = Content.Load <Texture2D>("sprite"); viewportPosition = new Vector2(map.ObjectGroups["4Events"].Objects["Spawn"].X - 80, map.ObjectGroups["4Events"].Objects["Spawn"].Y - 80); // TODO: use this.Content to load your game content here }