Beispiel #1
0
    public static void Draw_HISTOGRAM_POLY_FILL(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, params float[] _values)
    {
        int   _TOTAL_BINS  = _values.Length;
        int   _TOTAL_VERTS = (_TOTAL_BINS * 2);
        float _DIV         = _w / (_TOTAL_BINS - 1);

        GL_DRAW.Vert[] _VERTS = new GL_DRAW.Vert[_TOTAL_VERTS + 1];

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float _CURRENT = _x + (_DIV * i);

            // TOP VERT
            float _BIN_VALUE = _values[i];
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            _VERTS[i] = new GL_DRAW.Vert(_CURRENT, _y + (_h * _BIN_VALUE), _COL);

            // BTM VERT
            _VERTS[_TOTAL_VERTS - i] = new GL_DRAW.Vert(_CURRENT, _y, _col_MIN);
        }

        // now draw the poly
        for (int i = 0; i < _TOTAL_BINS - 1; i++)
        {
            GL_DRAW.Draw_QUAD(_VERTS[i], _VERTS[i + 1], _VERTS[_TOTAL_VERTS - (i + 1)], _VERTS[_TOTAL_VERTS - i]);
        }
    }
Beispiel #2
0
    public static void Draw_ArcGraph(Graph _graph, float _x, float _y, float _radius_START, float _radius_END, float _angle_MIN, float _angle_MAX, Color _col_MIN, Color _col_MAX, bool _alphaFade = false, int _sides = DEFAULT_ARC_SIDES, float _gutterRatio = DEFAULT_GUTTER_RATIO)
    {
        int   _COUNT         = _graph.binCount;
        float _DRAW_RANGE    = _radius_END - _radius_START;
        float _BAR_SPACE     = _DRAW_RANGE * _gutterRatio;
        float _BAR_THICKNESS = _BAR_SPACE / _COUNT;
        float _GUTTER        = (_DRAW_RANGE - _BAR_SPACE) / (_COUNT - 1f);
        float _ANGLE_RANGE   = _angle_MAX - _angle_MIN;

        for (int i = 0; i < _COUNT; i++)
        {
            float _BAR_START = _radius_START + ((i * _BAR_THICKNESS) + (i * _GUTTER));
            float _BIN_VALUE = _graph.Get_Value(i);
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_ARC_FILL(
                _sides,
                _x,
                _y,
                _angle_MIN,
                (_angle_MIN + (_ANGLE_RANGE * _BIN_VALUE)),
                _BAR_START,
                _BAR_START + _BAR_THICKNESS,
                (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL
                );
        }
    }
    public override void Draw()
    {
        base.Draw();

        // sprawls
        TXT("data sprawls :)", 0.1f, 0.9f, P.Get(4));
        float _DIVX = 0.8f / totalSprawls;

        for (int i = 0; i < totalSprawls; i++)
        {
            DataSprawl _sp = sprawls[i];
            _sp.Update();
            _sp.Draw(0.1f + (_DIVX * i), 0.7f, _DIVX, 0.1f, P.Get(i % P.totalColours));
        }


        // partitions
        TXT("partitions D:", 0.1f, 0.6f, P.Get(4));
        float _DIV_P     = 0.2f / partitionListCount;
        float _DIV_RAD   = 0.2f / partitionListCount;
        float _DIV_ANGLE = 0.5f / partitionListCount;

        for (int i = 0; i < partitionListCount; i++)
        {
            Partitions _P = partitionList[i];
            _P.AddRandom(0.001f, 1f, 1.2f, i, 1.5f * i, 0.01f * i, 0.05f * i);
            _P.ColourByShare(Color.red, Color.white);
            HUD.Draw_BAR_PARTITIONS_FILL_X(0.5f, 0.4f - (i * _DIV_P), 0.4f, _DIV_P, partitionList[i]);
            GL.PushMatrix();
            GL_DRAW.Rotate(Anim.Runtime(i * 0.005f));
            HUD.Draw_ARC_PARTITIONS_FILL(partitionList[i], 20, 0.2f, 0.3f, 0.01f + (i * _DIV_RAD), _DIV_RAD, 0f, Anim.Sin_Time(1, 0.25f, _DIV_ANGLE * i, i));
            GL.PopMatrix();
        }
    }
    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();
            }
        }
    }
Beispiel #5
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);
     }
 }
Beispiel #6
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));
            }
        }
Beispiel #7
0
    public static void Draw_LABEL_LINE_Y(string _str, float _x, float _y, float _size, float _txt_height, Color _col_line_START, Color _col_line_END, Color _col_txt, float _txt_margin = DEFAULT_TEXT_MARGIN, float _rotation = 1)
    {
        GL.PushMatrix();
        GL_DRAW.TransformMatrix(_x, _y, _rotation);

        GL_DRAW.Draw_LINE(0, 0, 0, _size, _col_line_START, _col_line_END);
        GL_TXT.Txt(_str, 0, _size + _txt_margin, _txt_height / 5, _col_txt);

        GL.PopMatrix();
    }
Beispiel #8
0
    void DrawHoop(float _x, float _y, float _size, float _alphaStrength = 1f, float _start = 0, float _end = 1, float _angleOffset = 0)
    {
        float _HOOP_START     = _HOOP_SIZE * _size;
        float _HOOP_THICKNESS = 0.25f * _size;
        float _HOOP_END       = _HOOP_START + _HOOP_THICKNESS;
        float _ANGLE_START    = _start + _angleOffset;
        float _ANGLE_END      = _end + _angleOffset;

        GL_DRAW.Draw_ARC_FILL(_HOOP_SIDES, _x, _y, _ANGLE_START, _ANGLE_END, _HOOP_START, _HOOP_END, P.Get(3, _alphaStrength * 0.5f));
        GL_DRAW.Draw_ARC_FILL(_HOOP_SIDES, _x, _y, _ANGLE_START, _ANGLE_END, _HOOP_START, _HOOP_START + (_HOOP_THICKNESS * 0.25f), P.Get(3, _alphaStrength));
    }
Beispiel #9
0
    public static void Draw_ARC_PARTITIONS_FILL(Partitions _partitions, int _sides, float _x, float _y, float _radius, float _thickness, float _angle_start = 0, float _angle_end = 1, float _rotation = 0)
    {
        float _RADIUS_END = _radius + _thickness;
        float _angleRange = _angle_end - _angle_start;

        for (int i = 0; i < _partitions.count; i++)
        {
            Partition _P           = _partitions.Get(i);
            float     _ANGLE_START = _angleRange * _P.start;
            GL_DRAW.Draw_ARC_FILL(_sides, _x, _y, _ANGLE_START, _ANGLE_START + (_angleRange * _P.share), _radius, _radius + _thickness, _P.colour, _rotation);
        }
    }
Beispiel #10
0
 public override void Draw()
 {
     base.Draw();
     for (int i = 0; i < totalHistograms; i++)
     {
         GL.PushMatrix();
         GL_DRAW.TransformLerp(transform_start, transform_end, (float)i / totalHistograms);
         HUD.Draw_HISTOGRAM_POLY_FILL(0f, 0f, 0.5f, 0.2f, colour_A, colour_B, histograms[i].values);
         //GL_DRAW.Draw_LINE(0f, 0f, 0.1f, 0f, Color.cyan);
         GL.PopMatrix();
     }
 }
Beispiel #11
0
    public static void Draw_HISTOGRAM_LINE_X(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, params float[] _values)
    {
        int   _TOTAL_BINS = _values.Length;
        float _DIV        = _w / _TOTAL_BINS;

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float _CURRENT   = _x + (_DIV * i);
            float _BIN_VALUE = _values[i];
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_LINE(_CURRENT, _y, _CURRENT, _y + (_h * _values[i]), _COL);
        }
    }
Beispiel #12
0
    public static void Draw_HISTOGRAM_LINE_Y(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, bool _alphaFade, Histogram _histogram)
    {
        int   _TOTAL_BINS = _histogram.binCount;
        float _DIV        = _h / _TOTAL_BINS;

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float _CURRENT   = _y + (_DIV * i);
            float _BIN_VALUE = _histogram.Get_Value(i);
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_LINE(_x, _CURRENT, _x + (_w * _histogram.Get_Value(i)), _CURRENT, (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL);
        }
    }
Beispiel #13
0
        public void Draw(float _x, float _y, float _w, float _h, Color _col, float _gutterRatio = HUD.DEFAULT_GUTTER_RATIO)
        {
            float _ACTIVE_AREA = _h * _gutterRatio;
            float _GUTTER      = (_h - _ACTIVE_AREA) / ((totalRows - 1));
            float _ROW_HEIGHT  = _ACTIVE_AREA / totalRows;

            for (int i = 0; i < totalRows; i++)
            {
                int      _ROW_INDEX = ((currentRow + totalRows) - i) % totalRows;
                BitArray _ROW_CELLS = rows[_ROW_INDEX];
                GL_DRAW.Draw_RECT_CELLS(_x, _y + (i * _ROW_HEIGHT) + (i * _GUTTER), _w, _ROW_HEIGHT, _ROW_CELLS, _col, 1);
            }
        }
Beispiel #14
0
    public static void Draw_HISTOGRAM_LINE_Y(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, bool _alphaFade = false, params float[] _values)
    {
        int   _TOTAL_BINS = _values.Length;
        float _DIV        = _h / _TOTAL_BINS;

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float _CURRENT   = (_DIV * i);
            float _BIN_VALUE = _values[i];
            Color _COL       = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_LINE(_x, _CURRENT, _x + (_w * _values[i]), _CURRENT, (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL);
        }
    }
Beispiel #15
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));
    }
Beispiel #16
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);
            }
        }
    }
Beispiel #17
0
    public static void Draw_ARC_CELLS(float _x, float _y, float _radius_START, float _thickness, BitArray _cells, Color _col, float _angle_START = 0, float _angle_END = 1, float _gutterRatio = HUD.DEFAULT_GUTTER_RATIO, int _segmentSides = HUD.DEFAULT_ARC_SIDES, float _rotation = 0)
    {
        int   _TOTAL_CELLS     = _cells.Length;
        float _ANGLE_RANGE     = _angle_END - _angle_START;
        float _ANGLE_DRAW_AREA = _ANGLE_RANGE * _gutterRatio;
        float _DIV_ANGLE       = _ANGLE_DRAW_AREA / _TOTAL_CELLS;
        float _GUTTER_ANGLE    = (_ANGLE_RANGE - _ANGLE_DRAW_AREA) / (_TOTAL_CELLS - 1);

        for (int i = 0; i < _TOTAL_CELLS; i++)
        {
            if (_cells.Get(i))
            {
                float _START_ANGLE = _angle_START + ((i * _DIV_ANGLE) + (i * _GUTTER_ANGLE));
                GL_DRAW.Draw_ARC_FILL(_segmentSides, _x, _y, _START_ANGLE, _START_ANGLE + _DIV_ANGLE, _radius_START, _radius_START + _thickness, _col, _rotation);
            }
        }
    }
Beispiel #18
0
    void FloorMarker(float _x, float _y, float _size, float _value, int _dataIndex = 0, float _timeOffset = 0)
    {
        Color _COL        = P.Get(3);
        float _markerSize = _HOOP_SIZE * _size;
        float _valueInv   = 1f - _value;
        float _SIZE2      = _size * 0.5f;
        float _Y_OFFSET   = Mathf.Lerp(0.01f * _size, 0.4f * _size, _value);

        // floor hoop
        DrawHoop(_x, _y, _size, 0.05f + (_valueInv * 0.2f), _angleOffset: 0);
        DrawHoop(_x, _y, _SIZE2, 0.075f + (_valueInv * 0.05f), _angleOffset: 0);

        for (int i = 0; i < 3; i++)
        {
            float _ANGLE_OFF = 0.33f * i;
            DrawHoop(_x, _y, _size * 1.5f, 0.3f, _ANGLE_OFF, _ANGLE_OFF + .1666666f, _angleOffset: Anim.Runtime(-0.1f));
        }

        // raised
        DrawHoop(_x, _y + _Y_OFFSET, _size, 0.3f, _angleOffset: 0);

        for (int i = 0; i < 4; i++)
        {
            float _ANGLE_OFF = 0.25f * i;
            DrawHoop(_x, _y + _Y_OFFSET, _size * 0.75f, 0.3f, _ANGLE_OFF, _ANGLE_OFF + .125f, _angleOffset: Anim.Runtime(0.25f, _timeOffset * 0.2f));
        }

        HUD.Draw_LABEL_LINE_X("pt :: " + _dataIndex, _x, _y, _size * 2f, _size * 0.1f, P.Get(3, 0f), _COL, _COL);

        float _statPad  = _size * 0.2f;
        float _statPad2 = _statPad * 2;
        float _stat_W   = _size * 2;
        float _stat_H   = _size * 4;
        float _stat_X   = _size + _statPad;
        float _stat_Y   = -_stat_H - (_statPad * 2);

        GL.PushMatrix();
        GL_DRAW.TransformMatrix(_x, _y);
        GL_DRAW.Draw_RECT(_stat_X, _stat_Y, _stat_W, _stat_H, _COL);
        float[] _values = VALUES.RandomValues_NOISE_TIME(5, _offsetA: _timeOffset, _offsetB: _timeOffset * 1.4f);
        sprawls[_dataIndex].Draw(_stat_X + _statPad, _stat_Y + (_stat_H * 0.75f), _stat_W - _statPad2, _stat_H * 0.2f, _COL);
        HUD.Draw_HISTOGRAM_BAR_X(_stat_X + _statPad, _stat_Y + _statPad, _stat_W - _statPad2, _stat_H * 0.5f, _COL, _COL, 0.75f, false, _values);
        HUD.Draw_HISTOGRAM_BAR_X(_stat_X + _statPad, _stat_Y - (_statPad - (_stat_H * 0.75f)), _stat_W - _statPad2, _stat_H * -0.2f, P.Get(3, 0), P.Get(2), 0.75f, false, _values);
        GL.PopMatrix();
    }
    public override void Draw()
    {
        base.Draw();



        int   _COUNT  = 20;
        float _MIN    = 0.02f;
        float _MAX    = 0.05f;
        float _OFFSET = -0.2f;

        for (int i = 0; i < _COUNT; i++)
        {
            GL_DRAW.Draw_CIRCLE_FILL(20, Anim.Sin_Time(3f, 0.1f, 0.8f, i * _OFFSET), Anim.Cos_Time(1.5f, 0.1f, 0.8f, i * _OFFSET), Anim.Cos_Time(1.5f, _MIN, _MAX, i * _OFFSET), P.Lerp(0, 3, (float)i / _COUNT));
        }
        GL_DRAW.Draw_CHEVRON(mx_eased + 0.05f, my_eased + Mathf.Abs(Anim.Cos_Time(10f, 0f, 0.05f)), 0.1f, Anim.Sin_Time(10f, 0.15f, 0.17f), P.Lerp(3, 4, mx_eased));
        TXT("Use the \"anim\" class for simple animations", 0.2f, 0.75f, P.Get(4));
    }
Beispiel #20
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);
        }
    }
Beispiel #21
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);
        }
    }
Beispiel #22
0
    public void Update()
    {
        GL_DRAW.RESET_SKEW();
        MX        = Input.mousePosition.x / Screen.width;
        MY        = Input.mousePosition.y / Screen.height;
        MX_EASED += (MX - MX_EASED) / M_EASE;
        MY_EASED += (MY - MY_EASED) / M_EASE;
        currentScreen.SetMouse(MX, MY, MX_EASED, MY_EASED);
        mat.SetPass(0);
        GL.LoadOrtho();

        screenTimer -= Time.fixedDeltaTime;
        if (screenTimer < 0)
        {
            GotoNextScreen();
        }
        CheckKeys();
        Draw();
    }
Beispiel #23
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);
    }
Beispiel #24
0
 public static void Draw_MATRIX_ANIM_FRAME_RADIAL(
     List <BitArray> _frames,
     int _frame,
     int _cells_angle,
     int _cells_radius,
     int _totalFrames,
     float _x,
     float _y,
     float _radius_start,
     float _radius_end,
     Color _col,
     int _arcSides             = HUD.DEFAULT_ARC_SIDES,
     float _angle_start        = 0, float _angle_end = 1,
     float _gutterRatio_ANGLE  = HUD.DEFAULT_GUTTER_RATIO,
     float _gutterRatio_RADIUS = HUD.DEFAULT_GUTTER_RATIO,
     float _rotation           = 0)
 {
     GL_DRAW.Draw_MATRIX_RADIAL(_x, _y, _radius_start, _radius_end, _cells_angle, _cells_radius, _col, _frames[_frame % _totalFrames], _arcSides, _angle_start, _angle_end, _gutterRatio_ANGLE, _gutterRatio_RADIUS, _rotation);
 }
Beispiel #25
0
    public static void Draw_HISTOGRAM_RADIAL(float[] _values, float _x, float _y, float _radius_start, float _radius_end, Color _col_MIN, Color _col_MAX, bool _alphaFade = false, float _angle_start = 0, float _angle_end = 1, float _rotation = 1)
    {
        GL.PushMatrix();
        GL_DRAW.TransformMatrix(_x, _y, _rotation);
        int   _TOTAL_BINS   = _values.Length;
        float _RANGE_RADIUS = _radius_end - _radius_start;
        float _RANGE_ANGLE  = (_angle_end - _angle_start) * GL_DRAW.PI2;
        float _DIV_ANGLE    = _RANGE_ANGLE / _TOTAL_BINS;

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float   _CURRENT_ANGLE = _angle_start + (i * _DIV_ANGLE);
            float   _BIN_VALUE     = _values[i];
            Vector2 _POS_START     = GL_DRAW.PolarCoord(_CURRENT_ANGLE, _radius_start);
            Vector2 _POS_END       = GL_DRAW.PolarCoord(_CURRENT_ANGLE, _radius_start + (_RANGE_RADIUS * _BIN_VALUE));
            Color   _COL           = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE);
            GL_DRAW.Draw_LINE(_POS_START.x, GL_DRAW.LockAspect_Y(_POS_START.y), _POS_END.x, GL_DRAW.LockAspect_Y(_POS_END.y), (_alphaFade) ? COL.Set_alphaStrength(_COL, _BIN_VALUE) : _COL);
        }
        GL.PopMatrix();
    }
Beispiel #26
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);
        }
    }
Beispiel #27
0
    public static void Draw_HISTOGRAM_POLY(float _x, float _y, float _w, float _h, Color _col, params float[] _values)
    {
        int   _TOTAL_BINS  = _values.Length;
        int   _TOTAL_VERTS = (_TOTAL_BINS * 2);
        float _DIV         = _w / (_TOTAL_BINS - 1);

        GL_DRAW.Vert[] _VERTS = new GL_DRAW.Vert[_TOTAL_VERTS];

        for (int i = 0; i < _TOTAL_BINS; i++)
        {
            float _CURRENT = _x + (_DIV * i);

            // TOP VERT
            float _BIN_VALUE = _values[i];
            _VERTS[i] = new GL_DRAW.Vert(_CURRENT, _y + (_h * _BIN_VALUE), _col);

            // BTM VERT
            _VERTS[(_TOTAL_VERTS - 1) - i] = new GL_DRAW.Vert(_CURRENT, _y, _col);
        }
        GL_DRAW.Draw_POLY_LINE_CLOSE(_VERTS);
    }
    public override void Draw()
    {
        base.Draw();
        int   _DIVS_X        = 20;
        int   _DIVS_Y        = 20;
        float _txt_x         = 0.1f;
        float _txt_y         = 0.9f;
        float _start_x       = 0.1f;
        float _start_y       = 0.1f;
        float _w             = 0.7f;
        float _h             = 0.7f;
        float _grid_offset_x = Anim.PNoise(0.1f, 0.05f);
        float _grid_offset_y = Anim.PNoise(0.1f, 0.05f, _offsetA: 0.5f, _offsetB: 0.1f);
        Color _gridColour    = P.Get(2);
        Color _TXT_COL       = P.Lerp(3, 4, Anim.Sin_Time(10));
        float _TXT_SIZE      = Anim.Cos_Time(15, 0.0035f, 0.005f);

        if (timeRemaining < 0.2f)
        {
            TXT("DOTS", _txt_x, _txt_y, _TXT_COL, _TXT_SIZE);
            GL_DRAW.Draw_GRID_DOT(_start_x, _start_y, _w, _h, _DIVS_X, _DIVS_Y, _gridColour);
        }
        else if (timeRemaining < 0.4f)
        {
            TXT("LINES", _txt_x, _txt_y, _TXT_COL, _TXT_SIZE);
            GL_DRAW.Draw_GRID_LINE(_start_x, _start_y, _w, _h, _DIVS_X, _DIVS_Y, _gridColour, _grid_offset_x, _grid_offset_y);
        }
        else if (timeRemaining < 0.6f)
        {
            TXT("triangles", _txt_x, _txt_y, _TXT_COL, _TXT_SIZE);
            GL_DRAW.Draw_GRID_NGON(_start_x, _start_y, _w, _h, _DIVS_X, _DIVS_Y, 3, 0.01f, _gridColour);
        }
        else
        {
            TXT("zoom!!", _txt_x, _txt_y, _TXT_COL, _TXT_SIZE);
            GL_DRAW.Draw_ZOOM_GRID(_start_x, _start_y, _w, _h, _gridColour, _DIVS_X, _DIVS_Y, mx_eased, my_eased, 0.1f);
        }
    }
Beispiel #29
0
 public static void Draw_MATRIX_ANIM_FRAME(List <BitArray> _frames, int _frame, int _cellsX, int _cellsY, int _totalFrames, float _x, float _y, float _w, Color _col, float _rotation = 0)
 {
     GL_DRAW.Draw_MATRIX_RECT(_x, _y, _w, GL_DRAW.LockAspect_Y(_w), _cellsX, _cellsY, _col, _frames[_frame % _totalFrames], _rotation);
 }
    public override void Draw()
    {
        base.Draw();
        for (int i = 0; i < totalSprawls; i++)
        {
            DataSprawl _sp = sprawls[i];
            _sp.Update();
        }
        for (int i = 0; i < partitionListCount; i++)
        {
        }

        GL_DRAW.Draw_GRID_DOT(0, 0, 1, 1, 40, 40, P.Get(2, Anim.Sin_Time(25, 0.5f, 0.6f)));
        GL_DRAW.Draw_ZOOM_GRID(0, 0, 1, 1, P.Lerp(2, 3, my_eased), 20, 20, mx, my, 0.01f);

        // skewed edge rects
        GL_DRAW.SKEW(0.2f, 0f);


        HUD.Draw_LABEL_LINE_X("example: 1", 0.1f, 0.9f, Anim.Sin_Time(2f, 0.1f, 0.25f), 0.01f, P.Get(2), P.Get(3), P.Get(3));
        int   _BOXES       = 6;
        float _BOX_STARTX  = 0.1f;
        float _BOX_SIZE    = 0.05f;
        float _BOX_SPACING = 0.01f;

        for (int i = 0; i < _BOXES; i++)
        {
            HUD.Draw_LABEL_BOX(
                "exe_" + i,
                _BOX_STARTX + (i * _BOX_SIZE) + (i * _BOX_SPACING),
                0.8f,
                _BOX_SIZE,
                _BOX_SIZE,
                Anim.Sin_Time(10, 0.005f, 0.01f, i * 0.1f),
                0.1f,
                0.5f,
                P.Lerp(2, 3, (float)i / _BOXES),
                P.Get(0));
        }

        sprawls[0].Draw(0.05f, 0.5f, 0.05f, 0.2f, P.Get(3, Anim.Cos_Time(20, 0.1f, 0.15f, 0.1f)));
        sprawls[1].Draw(0.05f, 0.45f, 0.1f, 0.05f, P.Get(4, Anim.Cos_Time(20, 0.1f, 0.15f, 0.2f)));

        //GL_DRAW.Draw_RECT_FILL(0.1f, 0.5f, 0.1f, 0.1f, P.Get(2,Anim.Sin_Time(30,0.1f, 0.12f)));

        GL_DRAW.Draw_AXIS(0.1f, 0.1f, 0.1f, 0.5f, 0.01f, 0.005f, 20, 5, P.Get(2), P.Get(3));
        GL_DRAW.Draw_AXIS(0.11f, 0.1f, 0.11f, 0.5f, 0.01f, 0.005f, 40, 10, P.Get(2), P.Get(3));

        // histograms
        int   _HIST_COUNT    = 10;
        int   _BIN_COUNT     = 20;
        float _HIST_START_X  = 0.25f;
        float _HIST_START_Y  = 0.4f;
        float _HIST_END_X    = 0.4f;
        float _HIST_END_Y    = 0.1f;
        float _HIST_W        = 0.4f;
        float _BIN_W         = _HIST_W / _BIN_COUNT;
        float _HIST_H_MIN    = 0.2f;
        float _HIST_H_MAX    = 0.05f;
        float _HIST_H_DIV    = (_HIST_H_MAX - _HIST_H_MIN) / _HIST_COUNT;
        float _HIST_OFFSET_X = (_HIST_END_X - _HIST_START_X) / _HIST_COUNT;
        float _HIST_OFFSET_Y = (_HIST_END_Y - _HIST_START_Y) / _HIST_COUNT;

        for (int i = 0; i < _HIST_COUNT; i++)
        {
            int   i1  = i + 1;
            float _F  = (float)i / _HIST_COUNT;
            float _RF = 1f - _F;
            HUD.Draw_HISTOGRAM_BAR_X(_HIST_START_X + (i * _HIST_OFFSET_X), _HIST_START_Y + (i * _HIST_OFFSET_Y), _HIST_W, _HIST_H_MIN + (i * _HIST_H_DIV),
                                     P.Lerp(0, 3, _F), P.Lerp(0, 4, _F), 1, false,
                                     VALUES.RandomValues_NOISE_TIME(_BIN_COUNT, 1f, 1.1f, i1 * 0.01f, i1 * 0.02f));
        }
        float[] _polyValues = VALUES.RandomValues_NOISE_TIME(10, 1f, 1.1f, 0.1f, 0.2f, 0.1f, 0.5f);
        float   _polyX      = _HIST_END_X + (_HIST_OFFSET_X);
        float   _polyY      = _HIST_END_Y + (_HIST_OFFSET_Y);

        HUD.Draw_HISTOGRAM_POLY(_polyX, _polyY, _HIST_W, _HIST_H_MAX, P.Get(2), _polyValues);
        HUD.Draw_HISTOGRAM_LINE_X(_polyX, _polyY, _HIST_W, _HIST_H_MAX, P.Get(2), P.Get(2), _polyValues);



        for (int i = 0; i < _BIN_COUNT; i++)
        {
            DataSprawl _SPRAWL = sprawls[i];
            _SPRAWL.Draw(_HIST_END_X + (i * _BIN_W), _HIST_END_Y - 0.1f, _BIN_W, 0.05f, P.Lerp(3, 4, Anim.Sin_Time(3f, _timeOffset: i * 0.1f)));
        }

        for (int i = 0; i < partitionListCount; i++)
        {
        }
    }