Exemplo n.º 1
0
 public SimpleFontHandler(Font font, string text, Vector2f position, Color4f color)
 {
     this.font = font;
     this.position = position;
     this.color = color;
     this.text = text;
 }
Exemplo n.º 2
0
 public Face(Vector3f[] vertices, Vector2f[] textureVertices, Vector3f[] normalVertices, int polygonType)
 {
     this.vertices = vertices;
     this.textureVertices = textureVertices;
     this.normalVertices = normalVertices;
     this.polygonType = polygonType;
 }
Exemplo n.º 3
0
        public BillboardedQuad(Texture texture, Camera activeCamera, Vector3f position, Vector2f size)
        {
            this.texture = texture;
            this.position = position;
            this.size = size;
            this.camera = activeCamera;

            if (displayList == -1)
                createDisplayList();
        }
Exemplo n.º 4
0
        public MultiTexturedQuad(Texture t0, Texture t1, Texture t2, Vector2f pos)
        {
            this.pos = pos;
            this.width = 1.0f;
            this.height = 1.0f;

            this.t0 = t0;
            this.t1 = t1;
            this.t2 = t2;
            c = new Color4f(1.0f, 1.0f, 1.0f, 1.0f);
        }
Exemplo n.º 5
0
        public void Draw(string text, Vector2f position, Color4f color)
        {
            string[] rows = text.Split('\n');

            Gl.glPushMatrix();
            Gl.glColor4f(color.r, color.g, color.b, color.a);
            Gl.glTranslatef(position.x, position.y, 0.0f);
            for (int i = 0; i < rows.Length; i++)
            {
                font.Render(rows[i]);
                Gl.glTranslatef(0.0f, -fontSize, 0.0f);
            }
            Gl.glPopMatrix();
        }
Exemplo n.º 6
0
 public Vector2f subtract(Vector2f dest)
 {
     return new Vector2f(x - dest.x, y - dest.y);
 }
Exemplo n.º 7
0
 public void set(Vector2f src)
 {
     set(src.x, src.y);
 }
Exemplo n.º 8
0
 public Vector2f divides(Vector2f lower)
 {
     return new Vector2f(x / lower.x, y / lower.y);
 }
Exemplo n.º 9
0
 public Vector2f add(Vector2f dest)
 {
     return new Vector2f(x + dest.x, y + dest.y);
 }
Exemplo n.º 10
0
        public void Draw(string Text, Vector2f position, Color4f Color)
        {
            Gl.glBlendFunc(Gl.GL_ONE, Gl.GL_ONE);
            char[] TextCharArray = Text.ToCharArray();

            int LastIndex = 0;
            List<char[]> SubTextArrays = new List<char[]>();

            for (int i = 0; i < TextCharArray.Length; i++)
            {
                if (TextCharArray[i] == '\n')
                {
                    SubTextArrays.Add(Text.Substring(LastIndex, i - LastIndex).ToCharArray());
                    LastIndex = i + 1;
                }
            }
            SubTextArrays.Add(Text.Substring(LastIndex, Text.Length - LastIndex).ToCharArray());

            for (int i = 0; i < SubTextArrays.Count; i++)
            {
                DrawCharArray(SubTextArrays[i], position.x, position.y - (this.FontSize * i), Color);
            }

            Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
        }