StaticcameraStaticcameraGet the world space rotation of the camera that the gizmos are being rendered for.
StaticcolorStaticfarSets the distance at which gizmos start to fade out.
StaticgizmoThe default color of an icon. This changes based on whether the current icon is selected.
StaticgizmoStaticisEnables or disables the depth fading for further draw calls.
StaticisDetermines if depth-testing is enabled (Default: Enabled)
StaticisEnables depth testing, and renders the occluded portion with a tinted color. (Default: False)
StaticlayerStaticnearSets the distance at which gizmos start to fade out near the camera.
StaticocclusionStaticscreenStaticspecialStaticworldStaticworldStaticworldGets the rotation of the transform that will be applied to further draw calls
StaticworldStaticworldStaticalignAligns the transform of any further draw calls with the camera.
StaticdrawStaticdrawDraws a flat arrow.
Starting point of the arrow
End point of the arrow.
Normal of the arrow.
Width of the line of the arrow.
Length of the triangle tip. Does not influence overall length of the arrow (the line gets shorter instead)
Width of the triangle tip.
OptionaltipOffset: number
Moves the tip along the line of the arrow.
OptionaldoubleEnded: boolean
Whether the arrow has tips on both ends.
StaticdrawDraws a mesh representing 2D text facing the camera with the specified properties.
Position to render the text at. Text will be centered around this point.
Text to draw.
Font to use for rendering the text's characters.
OptionalfontSize: number
Size of the characters, in points.
Optionalanchor: Immutable<Vector2>
Anchor for placement. Vector2(0, 0) is the top left, Vector(1, 1) bottom right.
OptionalisUsingPixelPerfectLayout: boolean
If true, the actual size in pixels of the text is used to layout it relative to the anchor.
OptionalmaximumWidth: number
Maximum width of the text. If it is wider, it will be broken into multiple lines.
StaticdrawDraws a solid cone.
Position of the center of the base of the cone.
Orientation of the cone, pointing from center base to the tip of the cone.
Height of the cone (along the normal).
Radius of the base of the cone.
Scale applied to cone's disc width & height. Allows you to create elliptical cones.
Draws a solid cone.
StaticdrawStaticdrawStaticdrawDraws a solid cylinder.
Position of the center of the base of the cylinder.
Orientation of the cone, pointing from center base to the top of the cylinder.
Height of the cylinder (along the normal).
Radius of the cylinder.
Optionalscale: Immutable<Vector2>
Scale applied to cylinder's disc width & height. Allows you to create elliptical cones.
StaticdrawStaticdrawStaticdrawDraws an icon Image at the specified scene position.
The position at which to draw the icon.
The image to use as the icon.
Whether to use a fixed scale for the icon regardless of camera distance.
Optionalanchor: Immutable<Vector2>
The anchor point of the icon, defaults to center (0.5, 0.5).
StaticdrawStaticdrawStaticdrawDraws a solid mesh.
The mesh to render.
Optional base color texture.
Optional normal texture.
The orientation of the axis.
StaticdrawDraws a solid torus mesh representing a handle orbit.
StaticdrawStaticdrawStaticdrawStaticdrawDraws a solid skeleton bone.
The position of the joint (or start of the bone).
The radius of the bone.
If true, only lines will be drawn to the parent, and no cones
OptionaljointColor: Immutable<SRGBColor>OptionalparentColor: Immutable<SRGBColor>
Color of the parent bone
StaticdrawStaticdrawDraws a mesh representing 2D text with the specified properties.
Position to render the text at. Text will be centered around this point.
Direction of the text baseline in 3D space.
Up direction of the text in 3D space.
Text to draw.
Font to use for rendering the text's characters.
OptionalfontSize: number
Size of the characters, in points.
Optionalanchor: Immutable<Vector2>
Anchor for placement. Vector2(0, 0) is the top left, Vector(1, 1) bottom right.
OptionalisUsingPixelPerfectLayout: boolean
If true, the actual size in pixels of the text is used to layout it relative to the anchor.
OptionalmaximumWidth: numberStaticdrawDraws a solid torus.
The orientation of the torus.
The radius of the torus.
The tube radius of the torus.
The quality of subdivision of the torus.
StaticdrawStaticdrawStaticdrawStaticdrawDraws a wireframe cone.
Draws a wireframe cone.
Position of the center of the base of the cone.
Orientation of the cone, pointing from center base to the tip of the cone.
Height of the cone (along the normal).
Radius of the base of the cone.
Scale applied to cone's disc width & height. Allows you to create elliptical cones.
StaticdrawStaticdrawDraws the corners of a wireframe cuboid.
Center of the cuboid.
Size of the cuboid.
Size of the drawn corners.
OptionalisCornerSizeRelative: boolean
If true, cornerSize is interpreted as a fraction of extents. Otherwise, cornerSize is the absolute size of the corners.
StaticdrawDraws a wireframe cylinder.
Position of the center of the base of the cylinder.
Orientation of the cylinder, pointing from center base to the top of the cylinder.
Height of the cylinder (along the normal).
Radius of the cylinder.
Optionalscale: Immutable<Vector2>
Scale applied to cylinder's disc width & height. Allows you to create elliptical cones.
StaticdrawStaticdrawStaticdrawStaticdrawStaticdrawStaticdrawDraws a skeleton bone.
The position of the joint (or start of the bone).
The position of the parent bone.
The radius of the bone.
If true, only lines will be drawn to the parent, and no cones
OptionalboneColor: Immutable<SRGBColor>
Color of the bone
OptionalparentColor: Immutable<SRGBColor>
Color of the parent bone
StaticdrawStaticgetCalculates the size of an icon in world space.
The size of the icon, in world space.
StaticgetStaticgetCalculates the size of the given text in world space.
The text to calculate the size of.
The font of the text.
OptionalfontSize: number
The font size.
OptionalisPixelPerfect: boolean
If true will calculate only the size of the pixels actually affected. Otherwise line spacing and other empty space will be included in the size.
OptionalmaximumWidth: number
Maximum width of the text. If it is wider, it will be broken into multiple lines.
The size of the rectangle the text will occupy, in world space.
StaticgetCalculates the size of the given text in pixels. Assumes the text is facing the camera and located at the position set with
SetTransform.
The text to calculate the size for.
The font of the text.
OptionalfontSize: number
Font size of the text.
The exact size of the text on the screen, in pixels.
StatictoCalculates how big (in pixels) a rectangle with the given size, facing the camera, would be at the given position.
How big the rectangle would be, in pixels.
StatictoCalculates how big a rectangle on the screen with the given size would be at the given position.
How big the rectangle would be in world space units.
The Gizmos class provides rendering and picking of gizmo elements.
Gizmos are icons and 3D objects usually rendered in scene view for various visualization purposes. For example a Camera component will have a gizmo that draws a camera icon since otherwise it has no visual representation. Aside from being rendered, gizmos can also be selected by the user as if they were normal scene elements.
To add a gizmo to a scene, apply the
@drawGizmodecorator to a static method.