123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|610|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Centering after Scaling

Fri, 04 Aug 2017, 04:38
spinal
hmmmm this is wrong when myScale is anything other than 1

-=-=-
Check out my excellent homepage!
Fri, 04 Aug 2017, 04:38
Jayenkai
I'm in two minds whether to attempt to make that work in the shoutbox or not.. Given the number of fuckups that the simple links generate, I'm inclined to not actually bother!

First thought, ensure you're using floats all over that.. use 2.0's and float() all the variables.
Don't forget to make Off_Y a float, too.

On top of that, I typically find that I have to add a 0.5 (or maybe subtract?!) from the total number of tiles. The maths always seems to be off by half a tile, although that may be due to me using centered sprites, nowadays.

-=-=-
''Load, Next List!''
Fri, 04 Aug 2017, 09:22
GfK
Probably quicker to use *0.5 instead of /2 - I think it's generally faster.
Fri, 04 Aug 2017, 09:27
Jayenkai
Been a while since I tested, but yeah it used to be better using *0.5, especially if you're doing lots of screenscaling maths.
Also, I recently found that certain Android devices can be utterly shit at sin/cos.... not that I'd suggest the Razer Forge TV is cheap shit, but the OUYA was quicker than that.

-=-=-
''Load, Next List!''