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

Can't Nest CompoundSprites #26

Open
danhealy opened this issue May 17, 2021 · 0 comments
Open

Can't Nest CompoundSprites #26

danhealy opened this issue May 17, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@danhealy
Copy link
Owner

Due to expecting to call draw_override, there is an incompatibility when trying to add a Zif::CompoundSprite to the @sprites array on another Zif::CompoundSprite.

An example to illustrate this would be attempting to refactor the ExampleApp::FormField class to use a CompoundSprite for the background, like switching it to ExampleApp::MetalCutout instead of the simple white rectangle.

This class should probably be refactored a bit to handle this situation. The two major complications are:

  1. Only the top level CompoundSprite should be calling draw_override, and should reach into its descendants to draw them
  2. It must translate the positional and dimensional attributes down to the nested CompoundSprite (recursively). Specifically, the nested sprite should be positioned on screen relative to its parent's x/y and zoomed relative to its parentsource_w/h.
@danhealy danhealy added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed question Further information is requested and removed question Further information is requested labels May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant