Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Expansions.Missions.Editor.MENodeCanvas Class Reference
Inheritance diagram for Expansions.Missions.Editor.MENodeCanvas:

Public Member Functions

void Awake ()
 
void CalculateBorders ()
 Calcualtes a bounding box using all the nodes in the scene and sets it as the allowed area for the camera This method is currently called whenever a node has finally been set in place. And when a missions was just loaded. There should be a way to avoid recalculating the bounding box each placement, but due to time constraints I couldnt do it. More...
 
void FitCameraToArea ()
 This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum More...
 
void FitCameraToArea (bool clampMin, bool clampMax)
 This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum More...
 
void FitCameraToSelectedNodes ()
 Will Refit the Canvas camera to the currently Selected Nodes on the Canvas. More...
 
void FitCameraToSelectedNodes (bool clampMin, bool clampMax)
 Will Refit the Canvas camera to the currently Selected Nodes on the Canvas. More...
 
void FocusNode (MEGUINode node)
 Focus the Canvas on the passed in MEGUINode position and sets zoom level to 1. More...
 
void FocusStartNode ()
 Sets the camera to target the start node, and sets the zoom to the maximium value More...
 
Vector2 GetMousePointOnGrid ()
 Returns the cursor position into localspace of the nodecanvas More...
 
void Initialize (MissionEditorLogic meLogicRef)
 Runs once, used to initialize events and ui callbacks More...
 
void Load (ConfigNode node)
 
void OnDestroy ()
 Ondestroy will unsucribe from the appropiate events. More...
 
void OnDrag (PointerEventData eventData)
 The event when the mouse is dragged along the screen. Used to pan the camera around. More...
 
void OnMissionLoaded ()
 When a mission loads, this event will be called to reset the state of the editor. More...
 
void OnPointerClick (PointerEventData eventData)
 The event when the canvas is clicked, will be redirected to the EditorLogic More...
 
void OnPointerDown (PointerEventData eventData)
 The event when the mouse is held down. Used to store the dragging starting values More...
 
void OnPointerUp (PointerEventData eventData)
 The event when the mouse button is released. Used to panning the camera More...
 
void OnScroll (PointerEventData eventData)
 The event when the scroll wheel is used over the node canvas. Its mainly used for zoom in/out More...
 
bool PointerInsideCanvasView (PointerEventData pointerData)
 Tests if the mouse pointer is inside the canvas area More...
 
void Save (ConfigNode node)
 
void StopCanvasMovement ()
 Clears any movement that was caused from dragginc a canvas to the edge of the active area More...
 
void ToggleScrollLock (bool newValue)
 Prevents the mouse wheel to change the zoom distance of the canvas More...
 
void TryCanvasMovement (PointerEventData pointerData, MEGUINode draggedNode)
 Tests if the canvas can be moved to the edges when dragging a node More...
 
void Update ()
 

Static Public Member Functions

static Vector3 CheckSnap (Vector3 position)
 This method will clamp the given position to the grid if the SnapToGrid setting is true. Otherwise retunrs the same position More...
 

Static Public Attributes

static MENodeCanvas Instance
 

Protected Member Functions

void CheckZoomBoundries ()
 This method will check if any of the zoom buttons in the UI has to be disabled (if a value is maxed out) More...
 
void SetZoom (float newZoom)
 Set the Zoom to a new percentage (value will be clamped to within min and max). More...
 
void Zoom (float increment)
 Handles increments and decremetns of the camera zoom More...
 
void ZoomIn ()
 Callback method for the zoom in button in the editor More...
 
void ZoomOut ()
 Callback method for the zoom out button in the editor More...
 

Properties

RectTransform NodeRoot [get]
 The transform that should contain all the guinodes More...
 
bool SnapToGrid [get, set]
 Makes the dragged nodes snap to the background grid when moved More...
 
Camera UICamera [get]
 The main camera that will see the canvas More...
 
float ZoomPercentage [get, set]
 The zoom percentage of the camera (1.0 to 0.3) More...
 

Member Function Documentation

void Expansions.Missions.Editor.MENodeCanvas.Awake ( )
inline
void Expansions.Missions.Editor.MENodeCanvas.CalculateBorders ( )
inline

Calcualtes a bounding box using all the nodes in the scene and sets it as the allowed area for the camera This method is currently called whenever a node has finally been set in place. And when a missions was just loaded. There should be a way to avoid recalculating the bounding box each placement, but due to time constraints I couldnt do it.

static Vector3 Expansions.Missions.Editor.MENodeCanvas.CheckSnap ( Vector3  position)
inlinestatic

This method will clamp the given position to the grid if the SnapToGrid setting is true. Otherwise retunrs the same position

Parameters
positionThe position that is required to be clamped by the SnapToGrid function if able
Returns
A position adjusted if SnapToGrid is set to true, otherwise the same that was given.
void Expansions.Missions.Editor.MENodeCanvas.CheckZoomBoundries ( )
inlineprotected

This method will check if any of the zoom buttons in the UI has to be disabled (if a value is maxed out)

void Expansions.Missions.Editor.MENodeCanvas.FitCameraToArea ( )
inline

This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum

void Expansions.Missions.Editor.MENodeCanvas.FitCameraToArea ( bool  clampMin,
bool  clampMax 
)
inline

This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum

Parameters
clampMinSet to True to clamp the zoom to the configured max
clampMaxSet to True to clamp the zoom to the configured max
void Expansions.Missions.Editor.MENodeCanvas.FitCameraToSelectedNodes ( )
inline

Will Refit the Canvas camera to the currently Selected Nodes on the Canvas.

void Expansions.Missions.Editor.MENodeCanvas.FitCameraToSelectedNodes ( bool  clampMin,
bool  clampMax 
)
inline

Will Refit the Canvas camera to the currently Selected Nodes on the Canvas.

Parameters
clampMinSet to True to clamp the zoom to the configured max
clampMaxSet to True to clamp the zoom to the configured max
void Expansions.Missions.Editor.MENodeCanvas.FocusNode ( MEGUINode  node)
inline

Focus the Canvas on the passed in MEGUINode position and sets zoom level to 1.

Parameters
node
void Expansions.Missions.Editor.MENodeCanvas.FocusStartNode ( )
inline

Sets the camera to target the start node, and sets the zoom to the maximium value

Vector2 Expansions.Missions.Editor.MENodeCanvas.GetMousePointOnGrid ( )
inline

Returns the cursor position into localspace of the nodecanvas

Returns
void Expansions.Missions.Editor.MENodeCanvas.Initialize ( MissionEditorLogic  meLogicRef)
inline

Runs once, used to initialize events and ui callbacks

Parameters
meLogicRefThe reference to the MissionEditor logic
void Expansions.Missions.Editor.MENodeCanvas.Load ( ConfigNode  node)
inline
void Expansions.Missions.Editor.MENodeCanvas.OnDestroy ( )
inline

Ondestroy will unsucribe from the appropiate events.

void Expansions.Missions.Editor.MENodeCanvas.OnDrag ( PointerEventData  eventData)
inline

The event when the mouse is dragged along the screen. Used to pan the camera around.

Parameters
eventDataThe mouse event
void Expansions.Missions.Editor.MENodeCanvas.OnMissionLoaded ( )
inline

When a mission loads, this event will be called to reset the state of the editor.

void Expansions.Missions.Editor.MENodeCanvas.OnPointerClick ( PointerEventData  eventData)
inline

The event when the canvas is clicked, will be redirected to the EditorLogic

Parameters
eventDataThe mouse event
void Expansions.Missions.Editor.MENodeCanvas.OnPointerDown ( PointerEventData  eventData)
inline

The event when the mouse is held down. Used to store the dragging starting values

Parameters
eventDataThe mouse event
void Expansions.Missions.Editor.MENodeCanvas.OnPointerUp ( PointerEventData  eventData)
inline

The event when the mouse button is released. Used to panning the camera

Parameters
eventDataThe mouse event
void Expansions.Missions.Editor.MENodeCanvas.OnScroll ( PointerEventData  eventData)
inline

The event when the scroll wheel is used over the node canvas. Its mainly used for zoom in/out

Parameters
eventDataThe mouse event
bool Expansions.Missions.Editor.MENodeCanvas.PointerInsideCanvasView ( PointerEventData  pointerData)
inline

Tests if the mouse pointer is inside the canvas area

void Expansions.Missions.Editor.MENodeCanvas.Save ( ConfigNode  node)
inline
void Expansions.Missions.Editor.MENodeCanvas.SetZoom ( float  newZoom)
inlineprotected

Set the Zoom to a new percentage (value will be clamped to within min and max).

Parameters
newZoom
void Expansions.Missions.Editor.MENodeCanvas.StopCanvasMovement ( )
inline

Clears any movement that was caused from dragginc a canvas to the edge of the active area

void Expansions.Missions.Editor.MENodeCanvas.ToggleScrollLock ( bool  newValue)
inline

Prevents the mouse wheel to change the zoom distance of the canvas

Parameters
newValue
void Expansions.Missions.Editor.MENodeCanvas.TryCanvasMovement ( PointerEventData  pointerData,
MEGUINode  draggedNode 
)
inline

Tests if the canvas can be moved to the edges when dragging a node

Parameters
pointerDataThe mouse data
draggedNodeThe node being scrolled in the edge
void Expansions.Missions.Editor.MENodeCanvas.Update ( )
inline
void Expansions.Missions.Editor.MENodeCanvas.Zoom ( float  increment)
inlineprotected

Handles increments and decremetns of the camera zoom

Parameters
level
void Expansions.Missions.Editor.MENodeCanvas.ZoomIn ( )
inlineprotected

Callback method for the zoom in button in the editor

void Expansions.Missions.Editor.MENodeCanvas.ZoomOut ( )
inlineprotected

Callback method for the zoom out button in the editor

Member Data Documentation

MENodeCanvas Expansions.Missions.Editor.MENodeCanvas.Instance
static

Property Documentation

RectTransform Expansions.Missions.Editor.MENodeCanvas.NodeRoot
get

The transform that should contain all the guinodes

bool Expansions.Missions.Editor.MENodeCanvas.SnapToGrid
getset

Makes the dragged nodes snap to the background grid when moved

Camera Expansions.Missions.Editor.MENodeCanvas.UICamera
get

The main camera that will see the canvas

float Expansions.Missions.Editor.MENodeCanvas.ZoomPercentage
getset

The zoom percentage of the camera (1.0 to 0.3)


The documentation for this class was generated from the following file: