This content has been marked as final. Show 2 replies
I've got a behaviour which can make sprites move fractionally between pixels like this, but it's fairly processor intensive (uses copypixels on a multiplied up version of the image) so I'm not sure how fast it would perform on a large background image.
Here it is:
It's just one behaviour which you place on a sprite, and once it's on you have to set the sprite's position using a 'setLoc()' command, with a floating point 'point', like this:
spriteRef.setLoc( point(10.3,21.9) )
More details are in the behaviour comments.
Hope this helps!
Thanks Ben, that worked well … one extra step was all it needed to make the motion much smoother. I had some trouble with the portion of the script that tests for an existing cast member, I found I could remove the test without any ill effects. You dispose of the cast member at the end of the script anyway.
tMem was never void, it returned “member -1 castlib 1” if the member didn’t exist. But since it’s deleted at the end of the script it never should exist before this point.
-- create a temp cast member to use, so we don't damage the original
tempName = "temp subpixel image for "&my&" frame "&the frame
-- tMem = member(tempName)
-- if voidP(tMem) then
tMem = new(#bitmap)
tMem.name = tempName
-- end if
my.member = tMem