view problems

Just started using Construct 2? Post your questions here

Post » Thu Oct 22, 2015 1:46 am

LittleStain wrote:the offset you need is the amount the center of "your view" is from the center of the view..


how do I get the middle of the built in view?
B
13
S
6
G
1
Posts: 150
Reputation: 1,962

Post » Thu Oct 22, 2015 9:19 pm

@LittleStain
Something like this?
http://imgur.com/c7dn9ut

if so what am I doing wrong?

Edit @LittleStain can you show me a diagram of of what you mean?
I feel like I don't understand
Code: Select all
clamp(player.X-20,10,LayoutWidth-view.Width+10)

as far as I can see the 20 could either be the offset of the hud(not view) or the view split into 3rds
and the 10 could either be the offset of the hud split into half or or the view split into 6ths?
B
13
S
6
G
1
Posts: 150
Reputation: 1,962

Post » Fri Oct 23, 2015 1:58 am

LittleStain wrote:Scrolling to player.x,player.y would put the player in the center of the view..
the offset you need is the amount the center of "your view" is from the center of the view..

ok so I think I found out what you mean by this however

LittleStain wrote:the clamping should be done by comparing the boundingbox of "your view" with the sides of the layout..

This I need a diagram to understand
B
13
S
6
G
1
Posts: 150
Reputation: 1,962

Post » Fri Oct 23, 2015 3:57 am

For Anybody wondering I figured it out you can see the camera code here
B
13
S
6
G
1
Posts: 150
Reputation: 1,962

Previous

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest