Exemplo n.º 1
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
                );
        }
    }
Exemplo n.º 2
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));
    }
Exemplo n.º 3
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);
        }
    }
Exemplo n.º 4
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);
        }
    }
Exemplo n.º 5
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();
    }
Exemplo n.º 6
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);
        }
    }
Exemplo n.º 7
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);
        }
    }