zoom/resolution problem

For questions about using Classic.

Post » Sat Aug 22, 2009 8:54 pm

I want to know if there is a way to zoom in on location other than center of the screen. To understand my problem try running say Platformer School tutorial files, or make simple scene where camera follows player controlled sprite on both Y and X. [preferably platform behavior]

Now set this cap to 1280x1024 on fullscreen or smth like that and zoom it in, either layout or just plain zoom. if you zoom in enough what will happen is that your player character will be left offscreen.

Even though camera is set to follow sprite, zooming in happens towards the center of the screen, so if player is at the bottom, and zoom happens at the center player will fall out of zoomed area.

is there a way to zoom in directly on player? like offseting zoom or changing zooming in point or something?

the way I was attempting to use it was on bigger resolutions I wanted to zoom in on screen so that in every resolution same amount of space would be visible at a time. I realized then that visual quality of game would be same as with just forcing smaller resolution in fullscreen, but there are other ways zooming in on player could be useful so...

thx in advance!
Posts: 138
Reputation: 2,795

Post » Sat Aug 22, 2009 9:39 pm

the reason why this happens is because construct limits the scrolling to within your layout, so it will never show any pixels outside your layout
unfortunately, it doesn't update these numbers as you zoom in.

to fix this problem, first check "unbounded scrolling" in your layout properties
this will allow it to show the outside of your layout
this is still not what you want however, because you don't want your players seeing a void outside your layout everytime you get near the edge of your screen

I made a cap with the math necessary to fix this
[code:3bmets29]scrollxLeft [/code:3bmets29]
is an expression that tells you which pixel location of your layout is on the left of your screen,

[code:3bmets29] ScrollXRight-ScrollXLeft[/code:3bmets29],
would tell you how many pixels wide the zoomed in area of your screen is regardless of zooming

is one half zoomed in screen of pixels from the left of your layout
which is where you would want the center of your screen if you wanted it as close to the left of your layout as possible when zoomed in, but not showing the outside of your layout

is the same thing, but on the right side of your layout

ask questions if you still don't understand after looking through the cap
I won't be on until tomorrow probably , but someone will probably be able to explain it a little better, and if not, when I log on, I'll try to clarify if you have questions

use the arrow keys to move the box
mousewheel zooms in and out

if you toggle those events off with the scrollx and scrolly, and just let it scroll to the green block
you'll see how it would display the outside of the layout without those extra events as you got closer to the edge
Spriter Dev
Posts: 3,228
Reputation: 16,287

Post » Sun Aug 23, 2009 7:13 pm

Thx man
Posts: 138
Reputation: 2,795

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests