コード例 #1
0
        protected override void Initialize()
        {
            this.graphicsDevice.CreateDevice();

            this.graphics = new GraphicsBatch(this.graphicsDevice);
            this.font = this.contentLoader.Load<TextureFont>(new LoadTextureFontArgs()
            {
                FileName = "GamePadReaderFont.xml"
            });
        }
コード例 #2
0
        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"
            });
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: smack0007/Snowball_v1
 private void GraphicsDeviceControl_Initialize(object sender, GraphicsDeviceEventArgs e)
 {
     this.graphics = new GraphicsBatch(e.GraphicsDevice);
 }
コード例 #5
0
ファイル: DemoGame.cs プロジェクト: smack0007/Snowball_v1
        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();
        }
コード例 #6
0
        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);
        }