feat(player)!: frame -> frame_no - #287
Merged
Merged
Conversation
Applies the playhead stem from the API conventions
(SDK `20_design/40_api_conventions.md`).
frame (property) -> frame_no
get_frame/set_frame -> get_frame_no/set_frame_no
The value is fractional -- sub-frame interpolation puts the playhead
between two authored frames -- and this node's own `frame_updated` signal
already calls its argument `frame_no`.
`AnimatedSprite2D.frame` is the obvious precedent to reach for, and it is
the reason to move rather than to keep: that one is an INTEGER index into
a SpriteFrames set, so a Godot reader seeing `frame` here is promised the
wrong type. The class reference now says so where the member is
documented.
The C++ names move with the bindings so the two layers keep one word,
which also carries the editor playback panel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies the playhead stem from the API conventions (SpriteStudio-SDK#383).
Why
The value is fractional — sub-frame interpolation puts the playhead between
two authored frames — and this node's own
frame_updatedsignal already callsits argument
frame_no. The rename makes the property and the signal agree.AnimatedSprite2D.frameis the obvious precedent to reach for, and it turned outto be the reason to move rather than to keep: that one is an integer index into a
SpriteFramesset. A Godot reader seeingframehere is promised the wrongtype. The class reference now says exactly that where the member is documented, so
the next person who wonders finds the answer in the docs rather than in this PR.
Scope
The bound names, the exported property (including the inspector range hint that
matches on the property name), and the C++ methods behind them — which move
together so the node and
SsInternalPlayerkeep one word. That also carries theeditor playback panel, which seeks through them.
Class reference, API docs, the scripting guide and troubleshooting follow;
set_frame(get_frame())— the documented force-a-redraw idiom — becomesset_frame_no(get_frame_no()).get_part_names()already satisfied the other half of #383, so it is untouched.Verification
All three changed translation units compile clean with the flags from the
checked-in
compile_commands.json(macOS arm64, GDExtension).Breaking, and taken now while nothing is published so no aliases are needed.