public UText(String text, UHAlign halign, UVAlign valign, bool isWrapped, float width, float height) { this.text = text; this.valign = valign; this.halign = halign; this.wrapped = isWrapped; this.width = width; this.height = height; _styleRanges.changed += new VoidAction(_styleRanges_collectionChanged); }
float GetShift(float layoutHeight, float textHeight, UVAlign align) { switch (align) { default: case UVAlign.Top: return(0); case UVAlign.Middle: return((layoutHeight - textHeight) / 2f); case UVAlign.Bottom: return(layoutHeight - textHeight); } }
ParagraphAlignment Translate(UVAlign v) { switch (v) { case UVAlign.Top: return(ParagraphAlignment.Near); case UVAlign.Middle: return(ParagraphAlignment.Center); case UVAlign.Bottom: return(ParagraphAlignment.Far); default: return(ParagraphAlignment.Near); } }
void dtt(float x, float y, UHAlign h, UVAlign v, Color cl, IDraw rt) { tt.halign = h; tt.valign = v; //rt.uDraw.FillRectangle(new Rectangle(x, y, 100, 100), new USolidBrush() { color = cl }); rt.uDraw.DrawText(tt, new Point(x, y), usb, UTextDrawOptions.None, false); }