Here’s what I’m trying to do:… I need a “deformable textured quad”, which I can easily manage with display.newImage(), setting its fill property to an image, then adjusting it’s path.property.
However, I also need that rect to have multiple frames, like a sprite, and preferably from an imagesheet (as opposed to discrete images)
Why? Because I need to change frames a lot, and sprite:setFrame() is way faster than something like (for example)
-- once: local rectFills = { { type="image", filename="images/fill1.png" } { type="image", filename="images/fill2.png" } } -- frame loop: rect.fill = rectFills[frameCount%2+1]
I want about a hundred such rects and the performance of setting rect.fill can’t match calling sprite:setFrame. (and yes, all images always remain cached, of course - no frameloop loading going on)
[[I can toggle between two instances of my renderer to compare them. Though, of course, the sprite method doesn’t look right without the deformations, but the function to deform is still “called”, that is: all the same path-setting math occurs even though it has no effect. So “essentially” the only difference is rect.fill= versus sprite:setFrame(). On a certain test device the sprite version runs 3.8ms/frame, while the rect.fill version runs 22.3ms/frame, about 5-6x slower. The ratio is similar on desktop simulator.]]
But alas, I can’t deform the sprite, (or, at least, not as far as I know!), and that’s a deal-killer too.
So,… Q: Is there any other combination (even if somewhat “wacky”) of features that might be able to mimic the desired result? That is: a “deformable textured quad” with frame-changing performance equivalent (or at least comparable) to sprite:setFrame()? There’s lots of new stuff in graphics/display and I’m hoping that maybe I’ve just overlooked a possibility??
Thanks in advance!