-
Notifications
You must be signed in to change notification settings - Fork 449
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
Detect changes to clipRect without needing to reset the field in order to take effect #3162
Comments
FlxRect
As I said in chat, I'm not a fan of FlxCallbackPoints for memory reasons and I'm even trying to do away with that in the long run. but I think there may be another way to detect changes to the clipRect field, i'll do some test when I have time |
@Sword352 had an idea of polling the current cliprect in draw() (and all other places) rather than triggering some refresh on change or detecting changes. I think this would work for actually rendering the sprite but fear it may make other affected getters more costly. Its worth consideration, nonetheless |
a "bit" late but do you mind sharing the idea you had in mind? depending on what it is i could attempt implementation and appropriate testing |
When I have time, I'll make a quick mock-up of what I have in mind, thanks for reminding me |
currently, using
FlxRect
for fields such asFlxSprite.clipRect
requires reassigning in order for changes to take effect. i've seen multiple people question this, and i've wondered if there's a simpler way around it.Some ideas:
FlxCallbackPoint
(potentiallyFlxCallbackRect
) that acts similarly to the callback point class.FlxRect
itself, possibly acallback
function that gets called when setting x, y, width, height.If we went with the latter, we could potentially remove
FlxCallbackPoint
and add similar functionality into the standardFlxPoint
class.The text was updated successfully, but these errors were encountered: