public AddRectangle ( RectangleF rect, System.Vector2 topLeftUV, System.Vector2 topRightUV, System.Vector2 bottomRightUV, System.Vector2 bottomLeftUV, ResourceHandle |
||
rect | RectangleF | |
topLeftUV | System.Vector2 | |
topRightUV | System.Vector2 | |
bottomRightUV | System.Vector2 | |
bottomLeftUV | System.Vector2 | |
materialHandle | ResourceHandle |
|
color | System.Color | |
return | void |
public void AddRectangle(RectangleF rect,
Vector2 topLeftUV, Vector2 topRightUV, Vector2 bottomRightUV, Vector2 bottomLeftUV,
ResourceHandle<Material> materialHandle, Color color)
{
Vertex v1, v2, v3, v4;
InitVetexes(out v1, out v2, out v3, out v4,
rect, color,
topLeftUV, topRightUV, bottomRightUV, bottomLeftUV);
unsafe
{
AddQuad(new IntPtr(&v1),new IntPtr(&v2),new IntPtr(&v3),new IntPtr(&v4), (uint)sizeof(Vertex), materialHandle);
}
}
GUIGeometryBuffer::AddRectangle ( RectangleF rect, System.Color color ) : void | |
GUIGeometryBuffer::AddRectangle ( RectangleF rect, System.Vector2 topLeftUV, System.Vector2 topRightUV, System.Vector2 bottomRightUV, System.Vector2 bottomLeftUV, ResourceHandle |
internal static void DrawText(GUIGeometryBuffer geometryBuffer, Font font, Vector2 position, String text, Color color) { for(var i = 0; i < text.Length; i++) { char c = text[i]; Glyph glyph; if (!glyphManager.TryGetGlyphInfo(font, c, out glyph)) { Log.Warn("Glyph not found for character " + c); continue; } SubTexture subTexture; ResourceHandle<Material> material; if (glyphManager.TryGetGlyphImage(font, c, out subTexture, out material)) { var renderRect = new RectangleF( position.X + glyph.XOffset, position.Y + glyph.BaseLineOffset, glyph.Width, glyph.Height); geometryBuffer.AddRectangle(renderRect, subTexture.LeftTopUV, subTexture.RightTopUV, subTexture.RightBottomUV, subTexture.LeftBottomUV, material, color); } if (i < text.Length-1){ var kern = glyphManager.GetKerning(font, text[i], text[i+1]); position.X += glyph.Advance + kern.X; position.Y += kern.Y; } } }