Scaling

BlitzMax Forums/BlitzMax Programming/Scaling

Regular K(Posted 2005) [#1]
When scaling, how would I go about keeping the images centered?

Lets say I have a 640x480 image, graphics are set to 640x480. I scale that image down to 0.5, how would I keep it in the center? (using math)

I hope Im clear

Thank you :D


Perturbatio(Posted 2005) [#2]
You could use MidHandleImage


Regular K(Posted 2005) [#3]
That doesn't appear to do anything for me =/

EDIT: Im not using one image, thats just an example, the screen can be made up of many 32x32 images (if that helps any)


Perturbatio(Posted 2005) [#4]
are you talking about a tilemap?

If so, I'd probably use SetOrigin to reposition the top left since I'd know what the width of the viewable area is, I could calculate where it should go.
Then simply draw the images as normal using the new width/height as a step.

This may not be explained clearly, but it's the best I can do just now, I'm rather tired :)