Esempio n. 1
0
        public void Render(Fontstash fons)
        {
            if (_active)
            {
                fons.SetColour(0xFF00FFFF);
            }
            else
            {
                fons.SetColour(0xFF000000);
            }

            fons.SetFont(fons.GetFontByName("stdfont"));
            fons.SetSize(18.0f);
            fons.DrawText(_x + 2.0f, _y + _height, _active ? _activeText : _text);
        }
Esempio n. 2
0
        public void Render(GL gl)
        {
            gl.Begin(PrimitiveType.Lines);
            if (_selected)
            {
                gl.Color4(0.0f, 1.0f, 0.0f, 1.0f);
            }
            else
            {
                gl.Color4(0.0f, 0.0f, 0.0f, 1.0f);
            }
            gl.Vertex2(_x, _y);
            gl.Vertex2(_x + _width, _y);
            gl.Vertex2(_x, _y);
            gl.Vertex2(_x, _y + _height);
            gl.Vertex2(_x + _width, _y);
            gl.Vertex2(_x + _width, _y + _height);
            gl.Vertex2(_x, _y + _height);
            gl.Vertex2(_x + _width, _y + _height);
            gl.End();

            _fons.SetFont(_fons.GetFontByName(_font));
            _fons.SetSize((float)_fontSize);
            _fons.SetColour(0xFF000000);
            _fons.DrawText(_x + 1.0f, _y + _height - 3.0f, _name + ": " + _text);
        }
Esempio n. 3
0
        public void Render(LevelSelectorStateRenderer renderer, Fontstash fons)
        {
            renderer.RenderQuad(_button.X, _button.Y, _button.Width, _button.Height, new Vector4(_colour, Hovering ? 1.0f : 0.75f));

            float size = 32;
            float x    = _button.X + size / 1.5f;
            float y    = _button.Y + size * 1.5f;

            for (int i = 0; i < _data.bestRating; i++)
            {
                renderer.RenderTexturedQuad(_state.Star, x + i * size, y, size, -size);
            }

            renderer.PrepareLegacy();
            fons.SetColour(0xFFFFFFFF);
            fons.SetFont(fons.GetFontByName("stdfont"));
            fons.SetSize(24.0f);
            fons.SetAlign((int)FonsAlign.Center | (int)FonsAlign.Middle);
            fons.DrawText(_button.X + _button.Width / 2.0f, _button.Y + _button.Height / 2.0f, _data.name);
            fons.SetSize(16.0f);
            fons.DrawText(_button.X + _button.Width / 2.0f, _button.Y + _button.Height / 2.0f + 35.0f, "Last Time: " + _data.bestTime.ToString());
            renderer.EndLegacy();
        }