Skip to content

Add OffsetOrigin enum for animated sprite pivot#118342

Open
RainCmd wants to merge 3 commits intogodotengine:masterfrom
RainCmd:add-offset-origin-enum
Open

Add OffsetOrigin enum for animated sprite pivot#118342
RainCmd wants to merge 3 commits intogodotengine:masterfrom
RainCmd:add-offset-origin-enum

Conversation

@RainCmd
Copy link
Copy Markdown

@RainCmd RainCmd commented Apr 9, 2026

Changes

This PR extends the offset pivot system of AnimatedSprite2D from only 2 positions (TopLeft, Center) to full 9 anchor positions:

  • TopLeft
  • TopCenter
  • TopRight
  • CenterLeft
  • Center
  • CenterRight
  • BottomLeft
  • BottomCenter
  • BottomRight

Added a new enum OffsetOrigin to control the offset starting point.
All positions are properly registered to ClassDB and exposed to scripting.

Reason

Previously, users could only offset from the top-left corner or center, which limited advanced positioning and animation layout workflows.
With 9-point origin support, users can now offset from any standard anchor point for more flexible sprite placement.

Test

Compiled successfully.
All enum values work correctly in both code and editor inspector.
Offset calculation behaves as expected.
Snipaste_2026-04-09_19-40-18
Snipaste_2026-04-09_19-40-48

@RainCmd RainCmd requested a review from a team as a code owner April 9, 2026 11:42
@Nintorch Nintorch added this to the 4.x milestone Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants