Example #1
0
        public override void PaintRadioButton(RadioButton component)
        {
            Position origin = UI.Instance.GetOrigin();

            SubImage checkStatus = null;
            if (component.Check == true)
            {
                checkStatus = radioButtonOn;
            }
            else
            {
                checkStatus = radioButtonOff;
            }
            switch (component.GetStatus())
            {
                case EButtonStatus.Normal:
                    {
                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        buttonNormalLeft.Paint(origin.X + component.Position.X, origin.Y + component.Position.Y, origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        buttonNormalRight.Paint(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y, origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y + 19);
                        GL.Disable(EnableCap.Texture2D);
                        GL.Color3((byte)55, (byte)67, (byte)65);
                        GL.Begin(BeginMode.Quads);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y + 19);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        GL.End();
                        GL.Color3((byte)137, (byte)155, (byte)145);

                        component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X + 15);
                        component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y - 4);
                        component.textFont.Render(true);

                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        checkStatus.Paint(origin.X + component.Position.X + component.Left, origin.Y + component.Position.Y + component.Top, origin.X + component.Position.X + component.Left + 11, origin.Y + component.Position.Y + component.Top + 11);
                        break;
                    }



                case EButtonStatus.Hover:
                    {
                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        buttonHoverLeft.Paint(origin.X + component.Position.X, origin.Y + component.Position.Y, origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        buttonHoverRight.Paint(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y, origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y + 19);
                        GL.Disable(EnableCap.Texture2D);
                        GL.Color3((byte)175, (byte)200, (byte)28);
                        GL.Begin(BeginMode.Quads);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y + 19);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        GL.End();
                        GL.Color3(0, 0, 0);

                        component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X + 15);
                        component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y - 4);
                        component.textFont.Render(true);

                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        checkStatus.Paint(origin.X + component.Position.X + component.Left, origin.Y + component.Position.Y + component.Top, origin.X + component.Position.X + component.Left + 11, origin.Y + component.Position.Y + component.Top + 11);
                        break;
                    }



                case EButtonStatus.Pressed:
                    {
                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        buttonNormalLeft.Paint(origin.X + component.Position.X, origin.Y + component.Position.Y, origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        buttonNormalRight.Paint(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y, origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y + 19);
                        GL.Disable(EnableCap.Texture2D);
                        GL.Color3((byte)55, (byte)67, (byte)65);
                        GL.Begin(BeginMode.Quads);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y);
                        GL.Vertex2(origin.X + component.Position.X + component.Size.width - 4, origin.Y + component.Position.Y + 19);
                        GL.Vertex2(origin.X + component.Position.X + 4, origin.Y + component.Position.Y + 19);
                        GL.End();
                        GL.Color3(0, 0, 0);

                        component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X + 15);
                        component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y - 4);
                        component.textFont.Render(true);

                        GL.Enable(EnableCap.Texture2D);
                        GL.Color3(1f, 1f, 1f);
                        checkStatus.Paint(origin.X + component.Position.X + component.Left, origin.Y + component.Position.Y + component.Top, origin.X + component.Position.X + component.Left + 11, origin.Y + component.Position.Y + component.Top + 11);
                        break;
                    }


            }
        }