Closed GoogleCodeExporter closed 9 years ago
Not a bug - the portion of the FilledSprite underneath the ImageSprite is
redrawn as the ImageSprite moves.
(The scene is drawn back-to-front) The clip of the CoreGraphics instance
contains the bounds of the dirty
rectangle.
A dirty-rectangle optimization would be to check if the ImageSprite is opaque,
and if so, not draw the portion of
the FilledSprite directly underneath the new location of ImageSprite. However,
a portion of the FilledSprite would
still need to be drawn as the ImageSprite moves to show what was underneath the
old location of the
ImageSprite.
Original comment by brack...@gmail.com
on 5 Apr 2009 at 5:41
OK. Thanks for the precisions.
Maybe a dumb question but : Is there a way to know if a drawSprite() is called
because it was dirty or because it was underneath a sprite that changed ?
checking the isDirty() method into the drawSprite() always give 'false'. Is
there any
other flag to test or a way to know if a Sprite is redrawn because one of its
property changed ?
Thanks for the help
Original comment by florent....@gmail.com
on 5 Apr 2009 at 6:01
No, there's no way to tell. It could be dirty, something over/under could be
dirty, its filter could be dirty, its
parent could be dirty, something nearby could be dirty (Scene2D expands dirty
rects in some cases) or it could
be a full-scene redraw. Also, a sprite's drawSprite() method can be called
multiple times per frame - once for
each dirty rectangle.
You can, however, get the dirty rectangle in drawSprite() - it's the
CoreGraphics' clip.
Original comment by brack...@gmail.com
on 5 Apr 2009 at 6:20
Original issue reported on code.google.com by
florent....@gmail.com
on 5 Apr 2009 at 5:28