view problems

Just started using Construct 2? Post your questions here

Post » Thu Aug 13, 2015 8:36 pm

sorry
the view is 640,480
the hud fills the entire screen
leaving a box for the view at the hud position of 222,76 with a width and height of 360
I also don't want my camera to let the player leave the centre of it
but have box for the view(not the hud) to stop at the Layout borders

what state do you think I should use?

Edit ya the hud is bouncing around
and its anchored

Edit Again: so right now I'm trying to...
set the scroll to postion to...
X: clamp(player.X-Xoffset,View.BBoxLeft,View.BBoxRight)
Y: clamp(player.Y-Yoffset,View.BBoxTop,View.BBoxBottom)
Xoffset being a global number of 82
Yoffset being a global number of 16
view being a object filling the view gap in my hud
it does good except when I get to the edge of the screen it doesn't clamp the view to the edge of the layout
it seems to be what I'm looking for though
I'm just not very good at math

just type this in at imgur.com
/hOKJgEe

its the pic of my hud
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sat Aug 15, 2015 5:01 am

C-7 better yet is there a 2d camera plugin for C2 that supports x y width and height?
maybe multiple cameras too?

Edit: or a way to off set the camera in this project depending on where the view is placed and its width and height?
Code: Select all
https://www.dropbox.com/s/uc15luie6knhwrq/Camera.capx?dl=0


here is a example of it not working
Code: Select all
https://www.dropbox.com/s/4nb795chybzj75n/Camera%20offset.capx?dl=0
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Sun Aug 16, 2015 11:59 pm

bump sorry
but I've been waiting about a week now and I still need help
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Thu Oct 15, 2015 7:17 pm

bump can someone help me I still need this

I want to make my camera system use 3 objects
the hud the view and the player to indicate where the camera is positioned

this right here https://www.dropbox.com/s/ejlmgsiypf31o ... .capx?dl=0
it works if I don't need to modify the views position or size
however I do so can someone take a look at this and write up a camera code I could use?

Edit: basically a view port however I know you can't draw things to the screen in construct 2 so
I need somebody's help for the math behind how it works
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Fri Oct 16, 2015 6:03 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 18, 2015 7:41 pm

yes thank you so much
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Wed Oct 21, 2015 7:23 pm

@LittleStain can you explain how this works?
I seem to be having problems understanding how the offset works

when I adjust the position and size of the view object it doesn't seem to offset the camera
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Wed Oct 21, 2015 7:44 pm

I made the offset based on the project you provided, so if you change the positions you should adjust the offset..
I'm not on my pc now, so I can't have a look, but if you know what you changed you should be able to change the pixels of the offset accordingly..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 21, 2015 9:33 pm

well the project you gave me seems to use a set values to clamp the view
It does however seem to resize correctly but I can't confirm it 100%

I have tried messing around with the values and changing them to variables but I can't seem to get it right

Edit: this is what I've been trying to make work
B
13
S
6
G
1
Posts: 149
Reputation: 1,960

Post » Wed Oct 21, 2015 10:48 pm

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..

the clamping should be done by comparing the boundingbox of "your view" with the sides of the layout..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: brunopalermo and 4 guests