コード例 #1
0
    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 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));
    }