-
Viewport Zoom Help
Hi all,
I'm currently trying to make a zoom function using the viewport object. but I'm having two problems, One is scrolling, when I move the player the viewport doesn't track correctly and the other is when I zoom out it just shrinks what I see and draws a black border around the edge instead of showing me more.
I'll post my file in the file archives.
Any Ideas?
Help is appreciated.
-
Re: Viewport Zoom Help
To fix the black border, you have to set the window to a size of more than 250x250 (so I'd set it to... 1000x1000) then resize the window to 250x250 using the window control object. This is making MMF2 draw more than what's on the screen.
I have no idea what the problem is with the scrolling thing.
-
Re: Viewport Zoom Help
How do I do this? could you make an example?
-
Re: Viewport Zoom Help
From what I can tell you can't zoom out with this object past the starting res of the screen only in. I'm not on my home computer with my project right now but I"ll look up details when I get a chance prolly this weekend.
-
Re: Viewport Zoom Help
OK so on startup set the viewport objects position to 0,0
Then set the source region to center and center it on your charcter or whatever the scrolling camera is bound to.
Set the center x and center y values to 1/2 the resolution that your game sets the screen too.
Then set the width and hight to the resolution of your screen.
Then create a counter or something that stores your zoom amount. Lets call it "zoom"
Then on whatever event you want the screen to zoom add the "zoom" counter to the width and hight values of the viewport object.
To zoom back out just subtract the "zoom" value from the viewport object
Make sure you never zoom out past the max rez or you will get the black boxes.
As far as I can tell you can never zoom out past the screen rez just in :).
-
Re: Viewport Zoom Help
Actually, does anyone know what's happened to the Viewport Object? I could REALLY use it right now! I've looked all over the net and the links seem to be broken, and the one I did manage to find was a 'bad file'. What's up with that?? I hope someone can help : S