コード例 #1
0
ファイル: TextElement.cs プロジェクト: ARLM-Attic/xna-xen
        private TextElement(SpriteFont font)
        {
            if (this.text == null)
            {
                this.text = new TextValue();
            }

            Texture2D texture = null;

            if (font != null)
            {
                this.font       = font;
                this.spriteFont = font;
                texture         = this.font.textureValue;
            }

            sprite = new SpriteElement(texture);
            sprite.VerticalAlignment = VerticalAlignment.Top;
            this.VerticalAlignment   = VerticalAlignment.Top;

            children = new TextChildren(sprite);
            SetParentToThis(sprite);

            sprite.AlphaBlendState = AlphaBlendState.Alpha;
        }
コード例 #2
0
ファイル: TextElement.cs プロジェクト: ARLM-Attic/xna-xen
        private TextElementRect(Vector2 sizeInPixels, SpriteFont font)
            : base(sizeInPixels)
        {
            if (font != null)
            {
                this.font = font;
            }

            this.spriteFont = font;

            sprite = new SpriteElement(font == null ? null : this.font.textureValue);
            sprite.VerticalAlignment = VerticalAlignment.Top;
            this.VerticalAlignment   = VerticalAlignment.Top;

            Add(sprite);

            this.children = new TextChildren(this.Children);

            sprite.AlphaBlendState = AlphaBlendState.Alpha;
        }