Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'slice' as a property to get and set slice9 values #8758

Merged
merged 2 commits into from Apr 5, 2024

Conversation

Jhonnyg
Copy link
Contributor

@Jhonnyg Jhonnyg commented Apr 4, 2024

Added a new property to sprites for getting and setting slice9 parameters. Examples:

local values = go.get("#sprite", "slice")
local value = go.get("#sprite", "slice.x")
go.set("#sprite", "slice", vmath.vector4(1,2,3,4))
go.set("#sprite", "slice.x", 1337)
go.animate("#sprite", "slice", go.PLAYBACK_LOOP_PINGPONG, vmath.vector4(96, 96, 96, 96), go.EASING_INCUBIC, 2)
go.animate("#sprite", "slice.x", go.PLAYBACK_LOOP_PINGPONG, 96, go.EASING_INCUBIC, 1)

Fixes #8740

@Jhonnyg Jhonnyg added feature request A suggestion for a new feature engine Issues related to the Defold engine sprite Issues related to sprites labels Apr 4, 2024
@Jhonnyg Jhonnyg marked this pull request as ready for review April 4, 2024 14:02
@Jhonnyg Jhonnyg requested a review from JCash April 4, 2024 14:03
@Jhonnyg Jhonnyg merged commit e7d4aff into dev Apr 5, 2024
22 checks passed
@Jhonnyg Jhonnyg deleted the issue-8740-get-set-slice9-for-sprites branch April 5, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Issues related to the Defold engine feature request A suggestion for a new feature sprite Issues related to sprites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slice 9 Left, Top, Right, Bottom values exposure
2 participants