We’ve noticed a weird effect when slowly scaling objects, it only seems to happen on iOS, and only on retina screens as far as we can tell.
We have tried to simulate people breathing by scaling them each frame. As the people are scaling, they kind of “snap” between one scale and the next. The scale changes are very small, so this shouldn’t be visible to the user, but it is on retina screens.
It looks like it could be some kind of rounding error perhaps, or maybe the devices have less accuracy when dealing with floats? If that’s the case then it seems strange that it work on an ipad 1.
I’ve stripped out the relevant part of my code, if someone else can confirm whether or not they see any jerky movements:
local people = {} local function update(e) for k, person in pairs(people) do --breathing if person.breathSin \> (math.pi \* 0.5) and person.breathSin \< (math.pi \* 1.5) then person.breathSin = person.breathSin + person.breathSpeedHalf else person.breathSin = person.breathSin + person.breathSpeed end if person.breathSin \>= 2\*math.pi then person.breathSin = person.breathSin - 2\*math.pi end person.xScale = 1 + math.sin(person.breathSin-1) \* 0.003 person.yScale = 1 + math.sin(person.breathSin) \* 0.0015 end end for i = 1, 5 do for j = 1, 5 do local person = newImageRect("myperson.png", 30, 50) person.x, person.y = (i \* 30)-15, (j \* 50)-25 person.breathSpeed = 0.025 + math.random() \* 0.01 person.breathSpeedHalf = person.breathSpeed \* 0.4 people[#people+1] = person end end Runtime:addEventListener( "enterFrame", update )