Class AnchorEditService
A service used to edit an anchor point on a sprite.
Implements
Inherited Members
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public class AnchorEditService : IAnchorEditService
Constructors
| Edit this page View SourceAnchorEditService(Gorgon2D, GorgonSprite, Rectangle)
Initializes a new instance of the AnchorEditService class.
Declaration
public AnchorEditService(Gorgon2D renderer, GorgonSprite anchorSprite, Rectangle bounds)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2D | renderer | The 2D renderer for the application. |
GorgonSprite | anchorSprite | The sprite representing the anchor icon. |
Rectangle | bounds | The boundaries for the anchor point. |
Properties
| Edit this page View SourceAnchorPosition
Property to set or return the position of the sprite anchor.
Declaration
public Vector2 AnchorPosition { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Camera
Property to set or return the camera for the renderer.
Declaration
public GorgonOrthoCamera Camera { get; set; }
Property Value
Type | Description |
---|---|
GorgonOrthoCamera |
CenterPosition
Property to set or return the center position of the sprite.
Declaration
public Vector2 CenterPosition { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
IsDragging
Property to return whether we're in the middle of a drag operation or not.
Declaration
public bool IsDragging { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceKeyDown(PreviewKeyDownEventArgs)
Function to intercept keyboard key presses.
Declaration
public bool KeyDown(PreviewKeyDownEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PreviewKeyDownEventArgs | e | The event arguments. |
Returns
Type | Description |
---|---|
bool | true if the event is handled, false if not. |
MouseDown(MouseArgs)
Function called when the mouse button is pressed.
Declaration
public bool MouseDown(MouseArgs args)
Parameters
Type | Name | Description |
---|---|---|
MouseArgs | args | The mouse event arguments. |
Returns
Type | Description |
---|---|
bool | true if the mouse event was handled, false if it was not. |
MouseMove(MouseArgs)
Function called when the mouse button is moved.
Declaration
public bool MouseMove(MouseArgs args)
Parameters
Type | Name | Description |
---|---|---|
MouseArgs | args | The mouse event arguments. |
Returns
Type | Description |
---|---|
bool | true if the mouse event was handled, false if it was not. |
MouseUp(MouseArgs)
Function called when the mouse button is released.
Declaration
public bool MouseUp(MouseArgs _)
Parameters
Type | Name | Description |
---|---|---|
MouseArgs | _ | Not used. |
Returns
Type | Description |
---|---|
bool | true if the mouse event was handled, false if it was not. |
Render()
Function to render the anchor UI.
Declaration
public void Render()
Reset()
Function to reset the anchor value.
Declaration
public void Reset()
Events
| Edit this page View SourceAnchorChanged
Event triggered when the anchor position is updated.
Declaration
public event EventHandler AnchorChanged
Event Type
Type | Description |
---|---|
EventHandler |