You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically intended as subsprites (#577), a RelativeSprite uses a separate attribute for its position. We'll call it relative_position. RelativeSprite.position becomes a property that returns the relative position in relation to the position and rotation of its parent.
For now, we'll leave RelativeSprite's own rotation alone, but if testing proves it necessary, rotation will need a similar split.
The goal is so that things like skeleton sprites (sprites who are made up of multiple sprites for animations), subordinate sprites (think r-types support ships), and particle systems don't need to worry about where they are in relation to the rest of their objects and can just move themselves, then get places appropriately by the renderer.
The text was updated successfully, but these errors were encountered:
Requires #666
Specifically intended as subsprites (#577), a
RelativeSprite
uses a separate attribute for its position. We'll call itrelative_position
.RelativeSprite.position
becomes a property that returns the relative position in relation to the position and rotation of its parent.For now, we'll leave RelativeSprite's own rotation alone, but if testing proves it necessary, rotation will need a similar split.
The basic idea:
return self.relative_position.rotate(self._parent.rotation) + self.parent.position
The goal is so that things like skeleton sprites (sprites who are made up of multiple sprites for animations), subordinate sprites (think r-types support ships), and particle systems don't need to worry about where they are in relation to the rest of their objects and can just move themselves, then get places appropriately by the renderer.
The text was updated successfully, but these errors were encountered: