-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Cursor Manager
The Custom Cursor Manager replaces the default mouse cursor with one that changes depending on states in the editor, as well as handling a selector frame on the tile the user's cursor hovers over.
List of connecting/parent/subsystems.
Connecting Systems:
- None
List of features and descriptions within system.
Custom Cursor:
- Visually reflects the user's current tool (Brush, Box Brush and Cursor)
- Each icon has a variant with an X to indicate invalid placement.
- Cursor tool is a hand which will point at editable entities and "grab" moving entities
- Reverts to the cursor image when hovering on UI elements.
- Takes Global State into account, if not in EDIT state -> mouse sprite is the basic cursor icon
Selector Frame:
- Snaps to the cell the user hovers on at any time.
- Changes appearance based on these states:
- White: Default
- Red: When deleting tiles
- Yellow: When hovering over an entity with the cursor tool (to edit)
- Cyan: When moving entities
- Magenta: When copying entities
- Invisible: When in a non-placeable area
Name the most important variables, their type, and what their purpose is
-
customIcon : Texture2D= Example of a preloaded icon texture. (exists for all tools and invalid variants) -
selectorFrame : Sprite2D= A frame indicator that highlights the cell the mouse hovers over. -
selectorState : enum= Dictates the state of the selector frame. -
currentMousePosition : Vector2= Where the mouse is at any given time.
Name of the most important functions, their parameters, and what they do.
-
func _process(delta : float) -> void: Updates the positions and behaviors selector frame and custom cursor every frame. -
func update_selector_state() -> void: Changes the state of the selector frame according to various conditions, such as erasing, moving or disappearing on invalid positions.
Future Work:
- Make the selector frame appear red when deleting entities and using box deletion.
- Fix "cyan" state to enable when the hold timer reaches 0.
Risks:
- Image loading is based on the file path in the res directory. Moving files could cause reference problems if this script isn't updated accordingly.
A place for miscellaneous notes pertaining to this system.
- None.
Resources
Known Issues
Future Work
Globals
Managers
- Main Menu Manager
- Master Manager
- Camera Manager
- Hotkey Manager
- Import Export Manager
- Audio Manager
- Animation Manager
- PopUp Manager
UI
Managers
- Editor Manager
- Tile Manager
- Entity Manager
- Icon Manager
- Preview Manager
- Tool Manager
- Asset Manager
- Custom Cursor Manager
Tiles & Entities
- Grid Lines
- Preview Line
- Tiles & Entities
- Enemies
- Patrolling Enemy
- Flying Enemy
- Shooting Enemy
- Stationary Enemy
- Moving Platform
- Property Editing
Asset Swapping
UI
Managers
Player