KROYSDOCS
HomeWhat's newv0.1.0
PLUGIN SDK / Viewport / Viewport

Viewport

Viewport drawing and camera for viewport tools (valid inside a tool's Draw).

Kindclass
NamespaceKroys.Plugins
Members7
SourceWorld.cs
DECLARATION

Declaration

Namespace Kroys.Plugins, assembly KroysPlugins.Sdk.dll.

Declaration
public sealed unsafe class Viewport
REFERENCE

Members

Methods
#public void DrawLine(Vector3 from, Vector3 to, Vector4 color, float thickness = 1.5f)
A line (RGBA 0..1).
method
#public void DrawCircle(Vector3 center, Vector3 normal, float radius, Vector4 color, float thickness = 1.5f)
A circle around normal.
method
#public void DrawBox(Vector3 minimum, Vector3 maximum, Vector4 color, float thickness = 1.5f)
An axis-aligned box.
method
#public void DrawPoint(Vector3 position, float size, Vector4 color)
A point.
method
#public void DrawLabel(Vector3 position, string text, Vector4 color)
A text label at a world position.
method
#public Vector2? WorldToScreen(Vector3 world)
Screen position (pixels from the viewport's top-left) of a world point; null when behind the camera.
method
#public void ActivateTool(string? toolId)
Activates a tool of this plugin by local id (null: none).
method
Signatures
public void DrawLine(Vector3 from, Vector3 to, Vector4 color, float thickness = 1.5f)
public void DrawCircle(Vector3 center, Vector3 normal, float radius, Vector4 color, float thickness = 1.5f)
public void DrawBox(Vector3 minimum, Vector3 maximum, Vector4 color, float thickness = 1.5f)
public void DrawPoint(Vector3 position, float size, Vector4 color)
public void DrawLabel(Vector3 position, string text, Vector4 color)
public Vector2? WorldToScreen(Vector3 world)
public void ActivateTool(string? toolId)

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.