//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Constructor. </summary> /// <param name="a_oEffect"> The shader program. </param> /// <param name="a_v3Pos"> The position of the first character. </param> /// <param name="a_v2Size"> Size of the first character. </param> /// <param name="a_oColor"> The color. </param> /// <param name="a_szFontDataFile"> (optional) the font data file. </param> //////////////////////////////////////////////////////////////////////////////////////////////////// public GLFont(GLEffect a_oEffect, Vector3 a_v3Pos, Vector2 a_v2Size, Color4 a_oColor, string a_szFontDataFile, string a_szText = "") { // load in data: m_oFontData = ResourceManager.Instance.LoadGLFont(a_szFontDataFile); m_v3Position = a_v3Pos; m_v2Size = a_v2Size; m_szText = a_szText; // Creat some working vars: Vector3 v3CharPos = new Vector3(); // create quads and position them accordingly: for (uint i = 0; i < c_uiMaxNumberOfChars; ++i) { // Create offseted position: v3CharPos.X = a_v3Pos.X + i * a_v2Size.X; v3CharPos.Y = a_v3Pos.Y; // Create Quad and set its texture: GLQuad oQuad = new GLQuad(a_oEffect, v3CharPos, a_v2Size, a_oColor); oQuad.TextureID = m_oFontData.m_uiTextureID; // add quad to the list: m_lQuads.Add(oQuad); } UpdateUVCoords(); }
private void CreateGraphic(SystemObjectRenderInfo sysObj) { var Graphic = new GLUtilities.GLQuad(glEffect, sysObj.PositionGL, sysObj.Size, sysObj.ItemColour, sysObj.ItemTextureName); }