Dungeon Architect  17.0.0
DungeonArchitect.Graphs.GraphCamera Class Reference

A camera that manages the graph editor's viewport More...

Public Member Functions

void Pan (int x, int y)
 Pan the camera along the specified delta value More...
 
void Pan (Vector2 delta)
 Pan the camera along the specified delta value More...
 
void HandleInput (Event e)
 Handles the user mouse and keyboard input More...
 
Vector2 WorldToScreen (Vector2 worldCoord)
 Converts world coordinates (in the graph view) into Screen coordinates (relative to the editor window) More...
 
Vector2 ScreenToWorld (Vector2 screenCoord)
 Converts the Screen coordinates (of the editor window) into the graph's world coordinate More...
 
Rect WorldToScreen (Rect worldCoord)
 Converts world coordinates (in the graph view) into Screen coordinates (relative to the editor window) More...
 
Rect ScreenToWorld (Rect screenCoord)
 Converts the Screen coordinates (of the editor window) into the graph's world coordinate More...
 
void FocusOnBestFit (Graph graph, Rect editorBounds)
 Moves the camera so most of the nodes are visible More...
 
void FocusOnNode (GraphNode node, Rect editorBounds)
 Moves the camera to the specified node More...
 

Public Attributes

Vector2 ScreenOffset = Vector2.zero
 

Properties

float MaxAllowedZoom [get, set]
 
Vector2 Position [get, set]
 Position of the camera More...
 
float ZoomLevel [get, set]
 Zoom scale of the graph camera More...
 

Detailed Description

A camera that manages the graph editor's viewport

Definition at line 12 of file GraphCamera.cs.

Member Function Documentation

◆ FocusOnBestFit()

void DungeonArchitect.Graphs.GraphCamera.FocusOnBestFit ( Graph  graph,
Rect  editorBounds 
)

Moves the camera so most of the nodes are visible

Parameters
graphThe graph to query
editorBoundsThe bounds of the editor window

Definition at line 162 of file GraphCamera.cs.

◆ FocusOnNode()

void DungeonArchitect.Graphs.GraphCamera.FocusOnNode ( GraphNode  node,
Rect  editorBounds 
)

Moves the camera to the specified node

Parameters
nodeThe node to focus on
editorBoundsThe bounds of the editor window

Definition at line 189 of file GraphCamera.cs.

◆ HandleInput()

void DungeonArchitect.Graphs.GraphCamera.HandleInput ( Event  e)

Handles the user mouse and keyboard input

Parameters
e

Definition at line 80 of file GraphCamera.cs.

◆ Pan() [1/2]

void DungeonArchitect.Graphs.GraphCamera.Pan ( int  x,
int  y 
)

Pan the camera along the specified delta value

Parameters
xDelta value to move along the X value
yDelta value to move along the Y value

Definition at line 62 of file GraphCamera.cs.

◆ Pan() [2/2]

void DungeonArchitect.Graphs.GraphCamera.Pan ( Vector2  delta)

Pan the camera along the specified delta value

Parameters
deltaThe delta offset to move the camera to

Definition at line 71 of file GraphCamera.cs.

◆ ScreenToWorld() [1/2]

Rect DungeonArchitect.Graphs.GraphCamera.ScreenToWorld ( Rect  screenCoord)

Converts the Screen coordinates (of the editor window) into the graph's world coordinate

Parameters
screenCoord
Returns
The world coordinates in the graph view

Definition at line 147 of file GraphCamera.cs.

◆ ScreenToWorld() [2/2]

Vector2 DungeonArchitect.Graphs.GraphCamera.ScreenToWorld ( Vector2  screenCoord)

Converts the Screen coordinates (of the editor window) into the graph's world coordinate

Parameters
screenCoord
Returns
The world coordinates in the graph view

Definition at line 122 of file GraphCamera.cs.

◆ WorldToScreen() [1/2]

Rect DungeonArchitect.Graphs.GraphCamera.WorldToScreen ( Rect  worldCoord)

Converts world coordinates (in the graph view) into Screen coordinates (relative to the editor window)

Parameters
worldCoordThe world cooridnates of the graph view
Returns
The screen cooridnates relative to the editor window

Definition at line 134 of file GraphCamera.cs.

◆ WorldToScreen() [2/2]

Vector2 DungeonArchitect.Graphs.GraphCamera.WorldToScreen ( Vector2  worldCoord)

Converts world coordinates (in the graph view) into Screen coordinates (relative to the editor window)

Parameters
worldCoordThe world cooridnates of the graph view
Returns
The screen cooridnates relative to the editor window

Definition at line 112 of file GraphCamera.cs.

Property Documentation

◆ Position

Vector2 DungeonArchitect.Graphs.GraphCamera.Position
getset

Position of the camera

Definition at line 26 of file GraphCamera.cs.

◆ ZoomLevel

float DungeonArchitect.Graphs.GraphCamera.ZoomLevel
getset

Zoom scale of the graph camera

Definition at line 45 of file GraphCamera.cs.


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