示例#1
0
        public override void Draw(float Alpha)
        {
            float Brightness = 0.35f + 0.15f * HoverAlpha;

            EditorStatic.DrawRectangle(MyRectangle, new Color(Brightness * Alpha, Brightness * Alpha, Brightness * Alpha, 0.5f * Alpha), true);


            Vector4 col;

            if (Selected)
            {
                col = new Vector4(0, 1, 1, 1) * Alpha;
            }
            else
            {
                col = new Vector4(0, 0, 0, 1) * Alpha;
            }
            EditorStatic.DrawRectangle(MyRectangle, new Color(col), false);

            if (Image != null)
            {
                Game1.spriteBatch.Draw(Image, ImageRectangle, new Color(Vector4.One * Alpha));
            }

            base.Draw(Alpha);
        }
示例#2
0
        public virtual void PreDraw()
        {
            Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, DepthStencilState.None, RasterizerState.CullNone, null, Matrix.CreateTranslation(ScrollRectangle.X, ScrollRectangle.Y, 0));
            Game1.graphicsDevice.SetRenderTarget(RenderTarget);
            Game1.graphicsDevice.Clear(new Color(0, 0, 0, 0));


            EditorStatic.DrawRectangle(ScrollRectangle, new Color(BackgroundColor * HoverAlpha), true);
            EditorStatic.DrawRectangle(ScrollRectangle, new Color(EdgeColor * HoverAlpha), false);
        }