How do I Zoom near of the edge of room zone.

Get help using Construct 2

Post » Tue Jun 14, 2016 6:27 pm

Hello To everyone!!
This is my first post.
I wondered if anyone can help me with my game, it's a metroidvania based game i'm stuck with a zoom problem maybe you guys can guide me.

I have a big layout divided by rooms (RoomZones).
When the player is near on the edge of the roomzone and gets zoom looks like this.

Image

This is actually my camera for the player (ScrollX/Y to the player but keep them within the boundaries of the current RoomZone).

Scroll To
X: clamp(Player_Base.X, RoomZone.X + RES_WIDTH / 2, RoomZone.X + RoomZone.Width - RES_WIDTH / 2)
Y: clamp(Player_Base.Y, RoomZone.Y + RES_HEIGHT / 2, RoomZone.Y + RoomZone.Height - RES_HEIGHT / 2)

How do i limit the zoom on the edge of the roomzone?
Any thoughts?

Thanks!!
B
24
S
4
Posts: 5
Reputation: 1,110

Post » Tue Jun 14, 2016 7:00 pm

Set Unbounded Scrolling to yes.
Make your own bounding with clamp.
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Tue Jun 14, 2016 8:24 pm

Thanks for the reply,
Can you be more specific with the "bouncing with clamp", please
B
24
S
4
Posts: 5
Reputation: 1,110

Post » Tue Jun 14, 2016 10:33 pm

Thats what this does.
Scroll To
X: clamp(Player_Base.X, RoomZone.X + RES_WIDTH / 2, RoomZone.X + RoomZone.Width - RES_WIDTH / 2)
Y: clamp(Player_Base.Y, RoomZone.Y + RES_HEIGHT / 2, RoomZone.Y + RoomZone.Height - RES_HEIGHT / 2)
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 38 guests