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