54 vector =
new Vector2(MathF.Cos(angle), MathF.Sin(angle));
56 vector3 = vector * (scale.X *
Font.Scale);
57 vector4 =
new Vector2(0f - vector.
Y, vector.
X) * (scale.Y *
Font.Scale);
66 vector2 += 0.5f * (vector3 * vector5.X + vector4 * vector5.
Y);
69 for (
int i = 0; i <= text.Length; i++) {
73 vector6 += num * (Font.GlyphHeight + vector5.
Y) * vector4;
75 if ((anchor &
TextAnchor.DisableSnapToPixels) == 0) {
95 public void Flush(
bool clearAfterFlush =
true) {
113 for (
int i = begin; i < end; i++) {
125 Vector2 vector5 = vector + vector4;
126 Vector2 vector6 = vector5 + vector2;
127 Vector2 vector7 = vector5 + vector3;
128 Vector2 vector8 = vector5 + vector2 + vector3;
130 TriangleVertices.Count += 4;
132 new Vector3(vector5.
X, vector5.
Y, depth),
137 new Vector3(vector6.
X, vector6.
Y, depth),
142 new Vector3(vector8.
X, vector8.
Y, depth),
147 new Vector3(vector7.
X, vector7.
Y, depth),
152 TriangleIndices.Count += 6;
160 float num = i < text.Length - 1 ?
Font.GetKerning(c, text[i + 1]) : 0f;
161 vector += right * (glyph.Width - num + fullSpacing);
void TransformTrianglesColors(Color color, int start=0, int end=-1)
SamplerState SamplerState
void TransformTriangles(Matrix matrix, int start=0, int end=-1)
readonly DynamicArray< int > TriangleIndices
readonly DynamicArray< VertexPositionColorTexture > TriangleVertices
Vector2 CalculateTextOffset(string text, int start, int count, TextAnchor anchor, Vector2 scale, Vector2 spacing)
static readonly BlendState AlphaBlend
static readonly DepthStencilState None
void Flush(Vector4 color, bool clearAfterFlush=true)
void QueueBatch(FontBatch2D batch, Matrix? matrix=null, Color? color=null)
void Flush(bool clearAfterFlush=true)
void QueueLine(string text, int begin, int end, float depth, Color color, float fullSpacing, Vector2 corner, Vector2 right, Vector2 down)
void QueueText(string text, Vector2 position, float depth, Color color, TextAnchor anchor, Vector2 scale, Vector2 spacing=default, float angle=0f)
void QueueText(string text, Vector2 position, float depth, Color color, TextAnchor anchor=TextAnchor.Default)
static Matrix ViewportMatrix()
static readonly RasterizerState CullNoneScissor
static readonly Matrix Identity
static readonly Vector2 Zero
static Vector2 Round(Vector2 v)
static readonly Vector2 One
static readonly Vector4 One