Пример #1
0
 //public bool animated = true;
 public void DrawBorder()
 {
     boundingbox.animateupdate(Globals.panelanimated);
     //RendererWrapper.SetBlendMode(RendererWrapper.BlendModes.Add);
     //RendererWrapper.DrawRectangle(boundingbox.ExpandTop(captionheight), bordercolor.Fade(0.5), glowradius, outer: true, glow: true);
     RendererWrapper.SetBlendMode(RendererWrapper.BlendModes.Normal);
     RendererWrapper.DrawRectangle(boundingbox, bordercolor, borderwidth, outer: true);
     RendererWrapper.DrawRectangle(boundingbox, bordercolor, -1);
     RendererWrapper.DrawRectangle(boundingbox, backgroundcolor, -1);
     RendererWrapper.DrawCaption(captionheight, boundingbox.left - borderwidth, boundingbox.top + borderwidth, caption, bordercolor);
 }
Пример #2
0
        public override void UpdateGraphics()
        {
            if (!inapp)
            {
                boundingbox.targetleft  = boundingbox.origleft * Globals.panelanimationratio;
                boundingbox.targetright = boundingbox.origright * Globals.panelanimationratio;
            }
            else
            {
                boundingbox.origleft = boundingbox.targetright - 1;
            }

            boundingbox.animateupdate(Globals.panelanimated);
            if (hover)
            {
                animationratio = 0.7 * animationratio + 0.3 * 0.2;
            }
            else
            {
                animationratio = 0.7 * animationratio + 0.3 * 0.0;
            }
            RectangleBox highlight = new RectangleBox(boundingbox.left, boundingbox.right, boundingbox.bottom,
                                                      animationratio * boundingbox.top + (1 - animationratio) * boundingbox.bottom);

            if (!border)
            {
                RendererWrapper.DrawRectangle(boundingbox, col, -1);
                RendererWrapper.DrawRectangle(highlight, col.Mix(col, new RGBAColor(1, 1, 1, 1), 0.5), -1);
            }
            else
            {
                RendererWrapper.DrawRectangle(boundingbox, new RGBAColor(0, 0, 0, 1), -1);
                RendererWrapper.DrawRectangle(highlight, col.Mix(col, new RGBAColor(1, 1, 1, 1), 0.5), -1);
                RendererWrapper.DrawRectangle(boundingbox, col, 2);
            }
            RendererWrapper.DrawString(boundingbox.left + 16, boundingbox.bottom + boundingbox.Height / 2 - 12.0 / 2, caption, new RGBAColor(1.0, 1.0, 1.0, 1.0));
        }