コード例 #1
0
        public override void Draw(GameTime gameTime)
        {
            GuiHelper.PushScissor(Clip);
            GuiHelper.SpriteBatch.FillRectangle(Bounds, Color.Black);
            GuiHelper.SpriteBatch.FillRectangle(new RectangleF(Left, Bottom - 20, Width, 20), Color.White * 0.5f);
            GuiHelper.PopScissor();

            base.Draw(gameTime);
        }
コード例 #2
0
ファイル: Icon.cs プロジェクト: Apostolique/Apos.Gui
        public override void Draw(GameTime gameTime)
        {
            GuiHelper.PushScissor(Clip);

            int halfWidth     = (int)(Width / 2);
            int iconHalfWidth = (int)(PrefWidth / 2);

            int halfHeight     = (int)(Height / 2);
            int iconHalfHeight = (int)(PrefHeight / 2);

            Vector2 pos = new Vector2(Left + halfWidth - iconHalfWidth, Top + halfHeight - iconHalfHeight);

            GuiHelper.SpriteBatch.Draw(Region, pos, Color.White);

            GuiHelper.PopScissor();
        }