Reputation: 12249
I've scaled my an object by .99 every frame for a certain amount of time. Then I scale it 1/.99 for the same amount of time. Due to rounding errors, the object ends up bigger/smaller instead of the same size. To fix this, I save the original width and height in variables and set object.contentWidth and contentHeigth equal to these variables whenever necessary. However, the object continues to grow or shrink and is never reset. When I print the original width and height variables, the content widths and heights, and the regular widths and heights, they're all the same value, as if the object was never scaled.
I assume the problem here is me misunderstanding the Corona SDK object functions and properties, so I didn't post any code. If it's not a misunderstanding, I'll post a simplified version of my code here; just let me know.
Upvotes: 1
Views: 4803
Reputation: 2023
I assume:
If you're trying to scale back to original size.
You should scale it from 0.99
to 1.0
, not to 1/.99
.
Use function object:scale()
for relative scaling
Use property object.xScale,object.yScale
for absolute scaling.
Try it with absolute scaling.
Upvotes: 1