Class MapSceneGUI

Namespace
TDMaker.Editor
Assembly
TDMaker.Editor.dll

Scene-view drawing and handles shared by the Map Editor and the Path Authoring inspector: road band (lanes plus the painted-road padding), every sub-lane, direction arrows, entry/exit markers, wave-call buttons and edit-point handles for curve and polyline paths.

public static class MapSceneGUI
Inheritance
MapSceneGUI
Inherited Members

Fields

PointHandle

Edit-point handle radius as a share of the handle size (about 10 screen pixels; 13 when selected).

public const float PointHandle = 0.13

Field Value

float

SelectedPointHandle

Edit-point handle radius as a share of the handle size (about 10 screen pixels; 13 when selected).

public const float SelectedPointHandle = 0.16

Field Value

float

WaveCallRadius

Wave-call button radius drawn in the Scene view (world units).

public const float WaveCallRadius = 0.45

Field Value

float

Methods

DrawPath(PathAuthoring, int, bool, float, bool)

Draws a path: road band, lanes, center line with arrows, entry/exit markers and its label (Repaint only).

public static void DrawPath(PathAuthoring path, int index, bool selected, float roadPadding, bool showEditPoints)

Parameters

path PathAuthoring
index int
selected bool
roadPadding float
showEditPoints bool

DrawRect(Rect, Color, string)

Draws a world rectangle outline with a caption.

public static void DrawRect(Rect r, Color color, string caption)

Parameters

r Rect
color Color
caption string

DrawWaveCall(PathAuthoring, bool)

Draws a path's wave-call button (where the HUD will show it).

public static void DrawWaveCall(PathAuthoring path, bool highlighted)

Parameters

path PathAuthoring
highlighted bool

EditPointHandles(PathAuthoring, ref int, float)

Draggable handles for a path's edit points (curve controls or polyline points). Updates selected when a handle is grabbed. Returns true when a point moved.

public static bool EditPointHandles(PathAuthoring path, ref int selected, float snapStep)

Parameters

path PathAuthoring
selected int
snapStep float

Returns

bool

FindInsert(PathAuthoring, Vector2, float, out int, out Vector2)

Where a new edit point would go for a click at world: on the nearest segment of the generated center line when within pickPixels, else -1. insertIndex is the edit-point index.

public static bool FindInsert(PathAuthoring path, Vector2 mouseGui, float pickPixels, out int insertIndex, out Vector2 world)

Parameters

path PathAuthoring
mouseGui Vector2
pickPixels float
insertIndex int
world Vector2

Returns

bool

Label(Vector3, Vector2, string, bool)

Draws a Scene-view label at a world point shifted by pixelOffset screen pixels. With leftAligned the label starts at that point, otherwise it is centred on it.

public static void Label(Vector3 world, Vector2 pixelOffset, string text, bool leftAligned = false)

Parameters

world Vector3
pixelOffset Vector2
text string
leftAligned bool

MouseWorld(Vector2, float)

World point under a GUI position on the XY plane at z.

public static Vector2 MouseWorld(Vector2 guiPoint, float z = 0)

Parameters

guiPoint Vector2
z float

Returns

Vector2

PickPoint(PathAuthoring, Vector2, float)

Index of the edit point within pickPixels of the mouse, or -1.

public static int PickPoint(PathAuthoring path, Vector2 mouseGui, float pickPixels)

Parameters

path PathAuthoring
mouseGui Vector2
pickPixels float

Returns

int

PixelDistance(PathAuthoring)

GUI distance in pixels from the mouse to a path's generated center line.

public static float PixelDistance(PathAuthoring path)

Parameters

path PathAuthoring

Returns

float

PixelRadius(Vector3, float)

Screen-pixel radius of a disc of world radius radius at world.

public static float PixelRadius(Vector3 world, float radius)

Parameters

world Vector3
radius float

Returns

float

WidthHandles(PathAuthoring, int, float)

Side handles at an edit point that set its lane width (needs two or more lanes).

public static void WidthHandles(PathAuthoring path, int index, float snapStep)

Parameters

path PathAuthoring
index int
snapStep float