protected override void Initialize() { this.graphicsDevice.CreateDevice(); this.graphics = new GraphicsBatch(this.graphicsDevice); this.font = this.contentLoader.Load<TextureFont>(new LoadTextureFontArgs() { FileName = "GamePadReaderFont.xml" }); }
protected override void Initialize() { this.graphicsDevice.CreateDevice(800, 600); // Renderer must be created after the graphics device is created. this.graphics = new GraphicsBatch(this.graphicsDevice); this.effect = this.contentLoader.Load<Effect>(new LoadEffectArgs() { FileName = "WavingFlag.fx" }); this.texture = this.contentLoader.Load<Texture>(new LoadTextureArgs() { FileName = "Flag.png" }); }
protected override void Initialize() { this.graphicsDevice.CreateDevice(800, 600); // GraphicsBatch must be created after the graphics device is created. this.graphics = new GraphicsBatch(this.graphicsDevice); this.animationOffset = 1; // Load a texture and wrap it in a SpriteSheet. The sheet contains frames which are 32x32. SpriteSheet spriteSheet = this.content.Load<SpriteSheet>(new LoadSpriteSheetArgs() { FileName = "wizard.png", FrameWidth = 32, FrameHeight = 32 }); this.sprite = new Sprite(spriteSheet); this.sprite.Position = new Vector2(this.Window.DisplayWidth / 2, this.Window.DisplayHeight / 2); this.sprite.Origin = new Vector2(16, 16); }
private void GraphicsDeviceControl_Initialize(object sender, GraphicsDeviceEventArgs e) { this.graphics = new GraphicsBatch(e.GraphicsDevice); }
protected override void Initialize() { this.graphicsDevice.CreateDevice(800, 600, false); this.soundDevice.CreateDevice(); this.console.Initialize(); this.console.BackgroundTexture = this.contentManager.Load<Texture>(DemoGameContent.ConsoleBackground); this.ship.LoadContent(this.contentManager); this.graphics = new GraphicsBatch(this.graphicsDevice); this.font = this.contentManager.Load<TextureFont>(DemoGameContent.Font); this.textBlock = new TextBlock(this.font, "This is text\nspanning multiple lines.", new Size(800, 600), TextAlignment.MiddleCenter, Vector2.One); this.starfield.Initialize(); this.ship.Initialize(); }
protected override void Initialize() { this.graphicsDevice.CreateDevice(); this.graphics = new GraphicsBatch(this.graphicsDevice); this.font = this.contentLoader.Load<TextureFont>(new LoadTextureFontArgs() { FileName = "TextBlockFont.xml" }); Size textBlockSize = new Size(this.graphicsDevice.BackBufferWidth / 3, this.graphicsDevice.BackBufferHeight / 3); this.topLeftTextBlock = new TextBlock(this.font, "Top\nLeft\nText\nBlock", textBlockSize, TextAlignment.TopLeft); this.topCenterTextBlock = new TextBlock(this.font, "Top\nCenter\nText\nBlock", textBlockSize, TextAlignment.TopCenter); this.topRightTextBlock = new TextBlock(this.font, "Top\nRight\nText\nBlock", textBlockSize, TextAlignment.TopRight); this.middleLeftTextBlock = new TextBlock(this.font, "Middle\nLeft\nText\nBlock", textBlockSize, TextAlignment.MiddleLeft); this.middleCenterTextBlock = new TextBlock(this.font, "Middle\nCenter\nText\nBlock", textBlockSize, TextAlignment.MiddleCenter); this.middleRightTextBlock = new TextBlock(this.font, "Middle\nRight\nText\nBlock", textBlockSize, TextAlignment.MiddleRight); this.bottomLeftTextBlock = new TextBlock(this.font, "Bottom\nLeft\nText\nBlock", textBlockSize, TextAlignment.BottomLeft); this.bottomCenterTextBlock = new TextBlock(this.font, "Bottom\nCenter\nText\nBlock", textBlockSize, TextAlignment.BottomCenter); this.bottomRightTextBlock = new TextBlock(this.font, "Bottom\nRight\nText\nBlock", textBlockSize, TextAlignment.BottomRight); }