Пример #1
0
 public bool Equals(Size other)
 {
     return this.Width == other.Width && this.Height == other.Height;
 }
Пример #2
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);
        }