protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); DisplayDevice = new XnaDisplayDevice(Content, GraphicsDevice); Viewport = new xRectangle(new Size(800, 600)); TileMap.Initialize(Content.Load <Texture2D>(@"textures/white"), Content.Load <SpriteFont>(@"fonts/pericles8")); }
/// <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. m_spriteBatch = new SpriteBatch(GraphicsDevice); m_xnaDisplayDevice = new XnaDisplayDevice(Content, GraphicsDevice); // load font for help text m_spriteFontDemo = Content.Load <SpriteFont>("Fonts/Demo"); m_textureLeaf = Content.Load <Texture2D>("Graphics/Leaf"); // load map from content pipeline and initialise it m_map = Content.Load <Map>("Maps\\Map01"); m_map.LoadTileSheets(m_xnaDisplayDevice); m_map.Layers[3].BeforeDraw += OnBeforeLayerDraw; // prepare translucent panel for help text m_texturePanel = new Texture2D(GraphicsDevice, 1, 1); m_texturePanel.SetData <Color>(new Color[] { new Color(0, 0, 0, 128) }); }
public MapDisplayDeviceIntercept(XnaDisplayDevice xna) { device = xna; textures = MoreMapLayers.helper.Reflection.GetPrivateValue <Dictionary <TileSheet, Texture2D> >(device, "m_tileSheetTextures"); }
public LoadTilesheetEventArgs(TileSheet tilesheet, XnaDisplayDevice device, Dictionary <TileSheet, Texture2D> textures) { this.tilesheet = tilesheet; this.device = device; this.textures = textures; }