public override void Draw()
    {
        base.Draw();

        TXT("Hi there!", 0.2f, 0.8f, P.Get(Anim.Runtime_int(3f) % P.totalColours), PRESENTATION.DEFAULT_TXT_CELL_HEIGHT * 2);
        TXT("Here is some info on the GL drawing tools", 0.2f, 0.75f, P.Get(4));

        TXT("draw primitives!", 0.2f, 0.6f, P.Get(4));

        int   _CELLS_X   = 10;
        int   _CELLS_Y   = 3;
        float _XDIV      = 0.6f / _CELLS_X;
        float _YDIV      = 0.4f / _CELLS_Y;
        float _CELL_SIZE = _XDIV * 0.75f;
        float _CS2       = _CELL_SIZE * 0.5f;

        int _COUNT = 0;

        for (int x = 0; x < _CELLS_X; x++)
        {
            for (int y = 0; y < _CELLS_Y; y++)
            {
                _COUNT++;
                Color _COL = P.Get(_COUNT % P.totalColours);
                GL.PushMatrix();
                //GL_DRAW.TransformMatrix(0.1f + (x * _XDIV), 0.1f + (y * _YDIV), _rotationZ: Anim.PNoise(0.1f, _offsetA: x, _offsetB: y));
                float _CS = Anim.Sin_Time(10f, _CS2, _CELL_SIZE, _COUNT);
                GL_DRAW.Translate(0.1f + (x * _XDIV), 0.1f + (y * _YDIV));

                switch (_COUNT % 6)
                {
                case 0:
                    GL_DRAW.Draw_RECT(0, 0, _CS, _CS, _COL);
                    break;

                case 1:
                    GL_DRAW.Draw_RECT_FILL(0, 0, _CS, _CS, _COL);
                    break;

                case 2:
                    GL_DRAW.Draw_CIRCLE_LINE(3, 0, 0, _CS, _COL);
                    break;

                case 3:
                    GL_DRAW.Draw_CIRCLE_FILL(3, 0, 0, _CS, _COL);
                    break;

                case 4:
                    GL_DRAW.Draw_CIRCLE_LINE(20, 0, 0, _CS, _COL);
                    break;

                case 5:
                    GL_DRAW.Draw_CIRCLE_FILL(20, 0, 0, _CS, _COL);
                    break;
                }
                GL.PopMatrix();
            }
        }
    }
示例#2
0
 public static void Draw_BAR_PARTITIONS_FILL_Y(float _x, float _y, float _w, float _h, Partitions _partitions)
 {
     for (int i = 0; i < _partitions.count; i++)
     {
         Partition _P = _partitions.Get(i);
         GL_DRAW.Draw_RECT_FILL(_x, _y + (_h * _P.start), _w, _h * _partitions.Get_Share(i), _P.colour);
     }
 }
示例#3
0
        public void Draw_Swatches(float _x, float _y, float _w, float _h)
        {
            float _XDIV = _w / totalColours;

            for (int i = 0; i < totalColours; i++)
            {
                GL_DRAW.Draw_RECT_FILL(i * _XDIV, _y, _XDIV, _h, Get(i));
            }
        }
示例#4
0
    void WallCell(float _x, float _y, float _w, float _h, Color _col, int _sprawlIndex, float _animOffset, float _tickerOffset)
    {
        bool  _TICKER = Anim.Runtime_int(5f, _tickerOffset) % 2 == 0;
        float _TOP    = _y + _h;
        float _lw     = _w * 0.5f;

        GL_DRAW.Draw_RECT(_x - (_w * 0.1f), _y + (_h * 0.1f), _lw, _h, COL.Set_alphaStrength(_col, 0.2f));
        GL_DRAW.Draw_RECT(_x - (_w * 0.05f), _y + (_h * 0.05f), _lw, _h, COL.Set_alphaStrength(_col, 0.2f));
        GL_DRAW.Draw_RECT_FILL(_x, _y, _lw, _h, COL.Set_alphaStrength(_col, 0.2f));
        GL_DRAW.Draw_RECT_FILL(_x, _TOP, _lw, _h * -0.1f, COL.Set_alphaStrength(_col, _TICKER ? 0.05f : 0.3f));
        HUD.Draw_LABEL_BOX("a" + _sprawlIndex, _x + (_lw * 0.1f), _y + (_h * 0.1f), _lw * 0.6f, _h * 0.6f, 0.01f, 0.1f, 0.5f, _col, P.Get(0));
        GL_MATRIX_ANIMS.Draw(GL_MATRIX_ANIMS.NAME_INC_3X3, Anim.Runtime_int(3f, _animOffset + Anim.Sin_Time(1.1f, 0f, 3f)), _x + _lw, _y + (_h * 0.75f), _h * 0.25f, _col);
        sprawls[_sprawlIndex].Draw(_x + _lw, _y + (_h * 0.75f), _lw * 0.25f, _h * -0.75f, COL.Set_alphaStrength(_col, 0.25f));
    }
示例#5
0
    public static void Draw_RECT_CELLS(float _x, float _y, float _w, float _h, BitArray _cells, Color _col, float _gutterRatio = HUD.DEFAULT_GUTTER_RATIO, float _rotation = 0)
    {
        int   _TOTAL_CELLS = _cells.Length;
        float _ACTIVE_AREA = _w * _gutterRatio;
        float _CELL_SIZE   = _ACTIVE_AREA / _TOTAL_CELLS;
        float _GUTTER_SIZE = (_w - _ACTIVE_AREA) / (_TOTAL_CELLS - 1);

        for (int i = 0; i < _TOTAL_CELLS; i++)
        {
            if (_cells.Get(i))
            {
                GL_DRAW.Draw_RECT_FILL(_x + (i * _CELL_SIZE) + (i * _GUTTER_SIZE), _y, _CELL_SIZE, _h, _col);
            }
        }
    }
示例#6
0
    public void Draw()
    {
        GL_DRAW.RESET_SKEW();
        currentScreen.Draw();
        Palette _P   = currentScreen.P;
        Color   _COL = _P.Get(4);

        GL_DRAW.RESET_SKEW();
        // screen name
        GL_TXT.Txt(currentScreen.title, SCREEN_TITLE_X, SCREEN_TITLE_Y, DEFAULT_TXT_CELL_HEIGHT, _COL);
        string _PAGE_STR = (currentScreen_index + 1) + "/" + totalScreens;

        // screen index status
        GL_TXT.Txt(_PAGE_STR, 1f - (((_PAGE_STR.Length + 2) * 3) * DEFAULT_TXT_CELL_HEIGHT), SCREEN_TITLE_Y, DEFAULT_TXT_CELL_HEIGHT, _COL);

        // time remaining line
        currentScreen.timeRemaining = 1f - (screenTimer / currentScreen.duration);
        GL_DRAW.Draw_RECT_FILL(0f, 0f, 0.005f, currentScreen.timeRemaining, _COL);
    }
示例#7
0
    public static void Draw_BarGraph_Y(Graph _graph, float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, bool _alphaFade = false, float _gutterRatio = DEFAULT_GUTTER_RATIO)
    {
        int   _COUNT         = _graph.binCount;
        float _BAR_SPACE     = _h * _gutterRatio;
        float _BAR_THICKNESS = _BAR_SPACE / _COUNT;
        float _GUTTER        = (_h - _BAR_SPACE) / (_COUNT - 1);

        for (int i = 0; i < _COUNT; i++)
        {
            float _BIN_VALUE = _graph.Get_Value(i);
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_RECT_FILL(
                _x,
                _y + ((_BAR_THICKNESS * i) + (_GUTTER * i)),
                _w * _BIN_VALUE,
                _BAR_THICKNESS,
                (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL);
        }
    }
示例#8
0
    public static void Draw_HISTOGRAM_BAR_X(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, float _gutterRatio, bool _alphaFade, params float[] _values)
    {
        int   _COUNT         = _values.Length;
        float _BAR_SPACE     = _w * _gutterRatio;
        float _BAR_THICKNESS = _BAR_SPACE / _COUNT;
        float _GUTTER        = (_w - _BAR_SPACE) / (_COUNT - 1);

        for (int i = 0; i < _COUNT; i++)
        {
            float _BIN_VALUE = _values[i];
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_RECT_FILL(
                _x + ((_BAR_THICKNESS * i) + (_GUTTER * i)),
                _y,
                _BAR_THICKNESS,
                _h * _BIN_VALUE,
                (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL);
        }
    }
示例#9
0
    public override void Draw()
    {
        base.Draw();

        // update data
        for (int i = 0; i < sprawlCount; i++)
        {
            sprawls[i].Update();
        }

        Floor();

        Skew_left();
        //Skew_right();

        int   _COUNT   = 6;
        float _CELLS_X = 0.1f;
        float _CELLS_Y = 0.5f;
        float _SPAN_X  = 0.6f;
        float _CELL_W  = _SPAN_X / _COUNT;
        float _CELL_H  = 0.05f;
        float _PAD     = 0.025f;

        GL_DRAW.Draw_RECT_FILL(_CELLS_X - _PAD, _CELLS_Y - _PAD * 0.5f, _SPAN_X, (_CELL_H * 2) + (_PAD * 2f), P.Get(0, 0.75f));
        for (int i = 0; i < _COUNT; i++)
        {
            float _FACTOR = (float)i / _COUNT;
            WallCell(_CELLS_X + (i * _CELL_W), _CELLS_Y, _CELL_W, _CELL_H, P.Lerp(2, 3, _FACTOR), i, i * .1f, i * 0.1f);
            int _ii = i + _COUNT;
            WallCell(_CELLS_X + (i * _CELL_W), _CELLS_Y + _CELL_H * 1.1f, _CELL_W, _CELL_H, P.Lerp(3, 2, _FACTOR), _ii, _ii * .1f, _ii * 0.1f);
        }

        // floor markers
        Skew_Floor();
        int _markerCount = 4;

        for (int i = 0; i < _markerCount; i++)
        {
            FloorMarker(0.1f + (i * 0.2f), 0.4f + (i * 0.098f), 0.04f, Anim.Sin_Time(_timeOffset: i * 0.1f), i, i * 0.2f);
        }
    }
示例#10
0
 public static void Draw_LABEL_BOX(string _str, float _x, float _y, float _w, float _h, float _txt_height, float _txt_x, float _txt_y, Color _col_PANEL, Color _col_TXT)
 {
     GL_DRAW.Draw_RECT_FILL(_x, _y, _w, _h, _col_PANEL);
     GL_DRAW.Draw_RECT_FILL(_x + _w + (_h * 0.05f), _y, (_h * 0.05f), _h, _col_PANEL);
     GL_TXT.Txt(_str, _x + (_w * _txt_x), _y + (_h * _txt_y), _txt_height / 5, _col_TXT);
 }