Example #1
0
        public override void DrawButton(UIButton b)
        {
            VTex2D bi;

            bi = StateImg(b.State);
            int     fw  = SmallFont.Width(b.Name);
            int     fh  = SmallFont.Height();
            Vector4 col = new Vector4(1, 1, 1, 1 * UISys.AlphaMod);

            switch (b.State)
            {
            case ButState.Norm:
                col = new Vector4(0.6f, 0.6f, 0.6f, 0.6f * UISys.AlphaMod);
                break;

            case ButState.Hover:
                col = new Vector4(0.8f, 0.8f, 0.8f, 0.8f * UISys.AlphaMod);
                break;

            case ButState.Press:
                col   = Vector4.One;
                col.W = col.W * UISys.AlphaMod;
                break;
            }
            VPen.Rect((int)b.WidX, (int)b.WidY, (int)b.WidW, (int)b.WidH, bi, col);
            VFontRenderer.Draw(SmallFont, b.Name, (int)(b.WidX + b.WidW / 2 - (fw / 2)), (int)(b.WidY + (b.WidH) / 2 - (fh / 2)), new Vector4(1, 1, 1, UISys.AlphaMod));
            if (b == UISys.Active)
            {
                VPen.Line(b.WidX, b.WidY + 4, b.WidX + b.WidW, b.WidY + 4, new Vector4(1, 1, 1, 1));
            }
        }
Example #2
0
 public override void DrawWindow(UIWindow w)
 {
     WinBackCol.W = w.Alpha * UISys.AlphaMod;
     //    VPen.Rect(w.WidX, w.WidY, w.WidW, w.WidH, WinBord, WinBackCol);
     VPen.Rect(w.WidX, w.WidY, w.WidW, w.WidH, WinCon, WinBackCol);
     if (w.DrawTitle)
     {
         WinTitCol.W = w.Alpha * UISys.AlphaMod;
         VPen.Rect(w.WidX, w.WidY, w.WidW, TitleHeight, WinTitle, WinTitCol);
         VFontRenderer.Draw(SmallFont, w.Name, w.WidX + 5, w.WidY + 2, new Vector4(1, 1, 1, UISys.AlphaMod));
     }
 }
Example #3
0
 public override void DrawPanel(UIPanel p)
 {
     if (p.Flat)
     {
         VPen.Rect(p.WidX, p.WidY, p.WidW, p.WidH, new Vector4(0.7f, 0.7f, 0.7f, 0.8f));
     }
     else
     {
         VPen.Rect(p.WidX, p.WidY, p.WidW, p.WidH, PanelBG, new Vector4(0.7f, 0.7f, 0.7f, 0.9f));
     }
     VFontRenderer.Draw(SmallFont, p.Name, p.WidX + 5, p.WidY + 5);
 }
Example #4
0
        public static void Draw(VFont font, string text, int x, int y, Vector4 col)
        {
            int dx = x;

            VPen.BlendMod = VBlend.Alpha;
            foreach (Char c in text)
            {
                VGlyph cg = font.Glypth[(int)c];
                VPen.Rect(dx, y, cg.W, cg.H, cg.Img, col);
                dx += (int)((float)cg.W / 1.3f);
            }
        }
Example #5
0
 public override void Draw()
 {
     VFontRenderer.Draw(UISys.Skin().SmallFont, Name, WidX + 5, WidY + 5, new OpenTK.Vector4(1, 1, 1, 1));
     if (WinOver == false)
     {
         VPen.Rect(WidX, WidY, WidW, 50, new OpenTK.Vector4(0, 0, 0.5f, 0.1f));
     }
     else
     {
         VPen.Rect(WidX, WidY, WidW, 50, new OpenTK.Vector4(0, 0, 0.5f, 0.35f));
         if (StarEngine.Input.VInput.MB[0] == false && UISys.ActiveWindow.Docked == false)
         {
             DockWin();
         }
     }
 }
Example #6
0
 public override void DrawBox(int x, int y, int w, int h)
 {
     VPen.Rect(x, y, w, h, new Vector4(0.2f, 0.2f, 0.2f, 0.8f * UISys.AlphaMod));
     VPen.Rect(x + 2, y + 2, w - 4, h - 4, new Vector4(0.9f, 0.9f, 0.9f, 0.8f * UISys.AlphaMod));
 }
Example #7
0
 public virtual void DrawImg(int x, int y, int w, int h, VTex2D img, Vector4 col)
 {
     VPen.Rect(x, y, w, h, img, col);
 }
Example #8
0
 public virtual void DrawRect(int x, int y, int w, int h, Vector4 c1, Vector4 c2)
 {
     VPen.Rect(x, y, w, h, c1, c2);
 }
Example #9
0
        public override void DrawState()
        {
            bool RenderDarkLogo()
            {
                VPen.Rect(0, 0, StarApp.W, StarApp.H, LogoTex, new OpenTK.Vector4(LogoAlpha, LogoAlpha, LogoAlpha, LogoAlpha));
                return(PresentLogo);
            }

            bool RenderPresLogo()
            {
                VPen.Rect(0, 0, StarApp.W, StarApp.H, this.PresTex, new OpenTK.Vector4(LogoAlpha, LogoAlpha, LogoAlpha, LogoAlpha));
                return(GameLogo);
            }

            bool RenderGameLogo()
            {
                //Console.WriteLine("Rendering!");

                VPen.Rect(0, 0, StarApp.W, StarApp.H, GameTex, new OpenTK.Vector4(LogoAlpha, LogoAlpha, LogoAlpha, LogoAlpha));
                return(ToMenu);
            }

            void DoMenu()
            {
                LogoAlpha = 0.0f;
                ms.Stop();

                StarApp.PushState(new MainMenuState());
            }

            bool CheckInput()
            {
                if (ToMenu)
                {
                    return(true);
                }
                if (VInput.MB[0])
                {
                    return(true);
                }
                if (VInput.KeyIn(OpenTK.Input.Key.Enter) || VInput.KeyIn(OpenTK.Input.Key.Space))
                {
                    return(true);
                }
                return(false);
            }

            //Logics.Do(TestDo);

            Graphics.When(CheckInput, DoMenu, null);

            Graphics.Flow(null, RenderDarkLogo);
            Graphics.Flow(null, RenderPresLogo);
            Graphics.Flow(null, RenderGameLogo);

            Graphics.SmartUpdate();

            return;

            void DarkLogo()
            {
                VPen.Rect(0, 0, StarApp.W, StarApp.H, LogoTex, new OpenTK.Vector4(LogoAlpha, LogoAlpha, LogoAlpha, LogoAlpha));
            }

            bool DarkLogoUntil()
            {
                return(PresentLogo);
            }

            void PresLogo()
            {
                VPen.Rect(0, 0, StarApp.W, StarApp.H, LogoTex, new OpenTK.Vector4(LogoAlpha, LogoAlpha, LogoAlpha, LogoAlpha));
            }

            bool PresentLogoUntil()
            {
                return(ReboundLogo);
            }

            void DoPresent()
            {
                Graphics.Do(PresLogo, PresentLogoUntil);
            }

            Graphics.Do(DarkLogo, DarkLogoUntil, DoPresent);

            Graphics.InternalUpdate();
        }
Example #10
0
        public void DrawForm(VTex2D tex, int x = 0, int y = 0)
        {
            VPen.BlendMod = VBlend.Alpha;

            VPen.Rect(GX + x, GY + y, W, H, CoreTex, Col);
        }