Class BackgroundGrid
Describes the canvas background grid.
Inheritance
BackgroundGrid
Assembly: Xareus.Scenarios.Unity.Edition.dll
Syntax
public class BackgroundGrid
Constructors
BackgroundGrid(VisualElement, int, int, float)
Declaration
public BackgroundGrid(VisualElement root, int spacing, int nbIntervals = 5, float magnetisationThreshold = 10)
Parameters
Fields
RawPosition
Position of the grid relative to the top left corner of the view (ignoring zoom)
Declaration
public Vector2 RawPosition
Field Value
Properties
BackgroundPositionX
Declaration
public StyleBackgroundPosition BackgroundPositionX { get; }
Property Value
Type |
Description |
StyleBackgroundPosition |
|
BackgroundPositionY
Declaration
public StyleBackgroundPosition BackgroundPositionY { get; }
Property Value
Type |
Description |
StyleBackgroundPosition |
|
BackgroundSize
Declaration
public StyleBackgroundSize BackgroundSize { get; }
Property Value
Type |
Description |
StyleBackgroundSize |
|
MagnetisationThreshold
Declaration
public float MagnetisationThreshold { get; }
Property Value
Position
Declaration
public Vector2 Position { get; set; }
Property Value
StyleBackground
Declaration
public StyleBackground StyleBackground { get; }
Property Value
Texture
Declaration
public Texture2D Texture { get; }
Property Value
Zoom
Declaration
public float Zoom { get; set; }
Property Value
Methods
GetMagnetisedPosition(Vector2)
Declaration
public Vector2 GetMagnetisedPosition(Vector2 position)
Parameters
Type |
Name |
Description |
Vector2 |
position |
|
Returns
GetMinDistToBigLine(float)
Computes the minimal distance to a "big" line on a given axis. There is a "big" line every "nbIntervals * spacing" units.
Val must be expressed in the business space.
Declaration
public float GetMinDistToBigLine(float val)
Parameters
Type |
Name |
Description |
float |
val |
|
Returns
GetMinDistToLine(float)
Computes the minimal distance to a line on a given axis. There is a line every "spacing" units.
Val must be expressed in the business space.
Declaration
public float GetMinDistToLine(float val)
Parameters
Type |
Name |
Description |
float |
val |
|
Returns
GetMinSignedDistToLine(float)
Compute the minimal signed distance to a line on a given axis. The value is negative if the value is "before" the line.
Val must be expressed in the business space.
Declaration
public float GetMinSignedDistToLine(float val)
Parameters
Type |
Name |
Description |
float |
val |
|
Returns
Move(Vector2)
Declaration
public void Move(Vector2 delta)
Parameters
Type |
Name |
Description |
Vector2 |
delta |
|
SetZoom(float, Vector2)
Declaration
public void SetZoom(float zoom, Vector2 zoomViewPosition)
Parameters
UpdateGrid()
Declaration