Gorgon
Show / Hide Table of Contents

Interface IAnchorEditService

A service used to edit an anchor point on a sprite.

Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IAnchorEditService
Remarks

Use this service when rendering the UI for editing the Anchor on a GorgonSprite. Plug in developers should use this to provide interaction with the anchor point.

Properties

| Edit this page View Source

AnchorPosition

Property to set or return the position of the sprite anchor.

Declaration
Vector2 AnchorPosition { get; set; }
Property Value
Type Description
Vector2
| Edit this page View Source

Camera

Property to set or return the camera for the renderer.

Declaration
GorgonOrthoCamera Camera { get; set; }
Property Value
Type Description
GorgonOrthoCamera
| Edit this page View Source

CenterPosition

Property to set or return the center position of the sprite.

Declaration
Vector2 CenterPosition { get; set; }
Property Value
Type Description
Vector2
| Edit this page View Source

IsDragging

Property to return whether we're in the middle of a drag operation or not.

Declaration
bool IsDragging { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

KeyDown(PreviewKeyDownEventArgs)

Function to intercept keyboard key presses.

Declaration
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.

| Edit this page View Source

MouseDown(MouseArgs)

Function called when the mouse button is pressed.

Declaration
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.

| Edit this page View Source

MouseMove(MouseArgs)

Function called when the mouse button is moved.

Declaration
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.

| Edit this page View Source

MouseUp(MouseArgs)

Function called when the mouse button is released.

Declaration
bool MouseUp(MouseArgs args)
Parameters
Type Name Description
MouseArgs args

The event arguments..

Returns
Type Description
bool

true if the mouse event was handled, false if it was not.

| Edit this page View Source

Render()

Function to render the anchor UI.

Declaration
void Render()
| Edit this page View Source

Reset()

Function to reset the anchor value.

Declaration
void Reset()

Events

| Edit this page View Source

AnchorChanged

Event triggered when the anchor position is updated.

Declaration
event EventHandler AnchorChanged
Event Type
Type Description
EventHandler

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author