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
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
WaveCallRadius
Wave-call button radius drawn in the Scene view (world units).
public const float WaveCallRadius = 0.45
Field Value
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
pathPathAuthoringindexintselectedboolroadPaddingfloatshowEditPointsbool
DrawRect(Rect, Color, string)
Draws a world rectangle outline with a caption.
public static void DrawRect(Rect r, Color color, string caption)
Parameters
rRectcolorColorcaptionstring
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
pathPathAuthoringhighlightedbool
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
pathPathAuthoringselectedintsnapStepfloat
Returns
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
pathPathAuthoringmouseGuiVector2pickPixelsfloatinsertIndexintworldVector2
Returns
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
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
guiPointVector2zfloat
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
pathPathAuthoringmouseGuiVector2pickPixelsfloat
Returns
PixelDistance(PathAuthoring)
GUI distance in pixels from the mouse to a path's generated center line.
public static float PixelDistance(PathAuthoring path)
Parameters
pathPathAuthoring
Returns
PixelRadius(Vector3, float)
Screen-pixel radius of a disc of world radius radius at world.
public static float PixelRadius(Vector3 world, float radius)
Parameters
worldVector3radiusfloat
Returns
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
pathPathAuthoringindexintsnapStepfloat