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
Right now, whenever you want a sprite that can do any sort of hit-testing, you have to (1) create a new Bounds and assign to localBounds, (2) assign its width and height (almost always from the image width and height).
It'd be nice to make life easier for the simple and common case, by automatically instantiating this localBounds as soon as you do any operation on the sprite that implies the need for one. So, as soon as you call contains, overlaps , worldBounds, corners, or setCorners; or use it as the argument to some other contains call.
When any of these things happen, if localBounds is null, then initialize it to a new Bounds set to match the current image of the sprite.
The text was updated successfully, but these errors were encountered:
Right now, whenever you want a sprite that can do any sort of hit-testing, you have to (1) create a new Bounds and assign to
localBounds
, (2) assign its width and height (almost always from the image width and height).It'd be nice to make life easier for the simple and common case, by automatically instantiating this localBounds as soon as you do any operation on the sprite that implies the need for one. So, as soon as you call
contains
,overlaps
,worldBounds
,corners
, orsetCorners
; or use it as the argument to some othercontains
call.When any of these things happen, if
localBounds
is null, then initialize it to a new Bounds set to match the currentimage
of the sprite.The text was updated successfully, but these errors were encountered: