![]() |
Kerbal Space Program
1.12.4
|
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... | |
|
inline |
|
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.
|
inlinestatic |
This method will clamp the given position to the grid if the SnapToGrid setting is true. Otherwise retunrs the same position
position | The position that is required to be clamped by the SnapToGrid function if able |
|
inlineprotected |
This method will check if any of the zoom buttons in the UI has to be disabled (if a value is maxed out)
|
inline |
This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum
|
inline |
This is the Fit-In-View method. Will make all the nodes of the mission fit inside the camera frustrum
clampMin | Set to True to clamp the zoom to the configured max |
clampMax | Set to True to clamp the zoom to the configured max |
|
inline |
Will Refit the Canvas camera to the currently Selected Nodes on the Canvas.
|
inline |
Will Refit the Canvas camera to the currently Selected Nodes on the Canvas.
clampMin | Set to True to clamp the zoom to the configured max |
clampMax | Set to True to clamp the zoom to the configured max |
|
inline |
Focus the Canvas on the passed in MEGUINode position and sets zoom level to 1.
node |
|
inline |
Sets the camera to target the start node, and sets the zoom to the maximium value
|
inline |
Returns the cursor position into localspace of the nodecanvas
|
inline |
Runs once, used to initialize events and ui callbacks
meLogicRef | The reference to the MissionEditor logic |
|
inline |
|
inline |
Ondestroy will unsucribe from the appropiate events.
|
inline |
The event when the mouse is dragged along the screen. Used to pan the camera around.
eventData | The mouse event |
|
inline |
When a mission loads, this event will be called to reset the state of the editor.
|
inline |
The event when the canvas is clicked, will be redirected to the EditorLogic
eventData | The mouse event |
|
inline |
The event when the mouse is held down. Used to store the dragging starting values
eventData | The mouse event |
|
inline |
The event when the mouse button is released. Used to panning the camera
eventData | The mouse event |
|
inline |
The event when the scroll wheel is used over the node canvas. Its mainly used for zoom in/out
eventData | The mouse event |
|
inline |
Tests if the mouse pointer is inside the canvas area
|
inline |
|
inlineprotected |
Set the Zoom to a new percentage (value will be clamped to within min and max).
newZoom |
|
inline |
Clears any movement that was caused from dragginc a canvas to the edge of the active area
|
inline |
Prevents the mouse wheel to change the zoom distance of the canvas
newValue |
|
inline |
Tests if the canvas can be moved to the edges when dragging a node
pointerData | The mouse data |
draggedNode | The node being scrolled in the edge |
|
inline |
|
inlineprotected |
Handles increments and decremetns of the camera zoom
level |
|
inlineprotected |
Callback method for the zoom in button in the editor
|
inlineprotected |
Callback method for the zoom out button in the editor
|
static |
|
get |
The transform that should contain all the guinodes
|
getset |
Makes the dragged nodes snap to the background grid when moved
|
get |
The main camera that will see the canvas
|
getset |
The zoom percentage of the camera (1.0 to 0.3)