Click or drag to resize

FontDrawChar Method

Draw character char into a canvas item using the font at a given position, with modulate color, and optionally kerning if next is passed. clipping the width. position specifies the baseline, not the top. To draw from the top, ascent must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public float DrawChar(
	RID canvasItem,
	Vector2 position,
	int char,
	int next = -1,
	Color? modulate = null,
	bool outline = false
)

Parameters

canvasItem
Type: GodotRID

[Missing <param name="canvasItem"/> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

position
Type: GodotVector2

[Missing <param name="position"/> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

char
Type: SystemInt32

[Missing <param name="char"/> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

next (Optional)
Type: SystemInt32

[Missing <param name="next"/> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

modulate (Optional)
Type: SystemNullableColor
If the parameter is null, then the default value is new Color(1, 1, 1, 1)
outline (Optional)
Type: SystemBoolean

[Missing <param name="outline"/> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

Return Value

Type: Single

[Missing <returns> documentation for "M:Godot.Font.DrawChar(Godot.RID,Godot.Vector2,System.Int32,System.Int32,System.Nullable{Godot.Color},System.Boolean)"]

See Also