Can anyone give me a detailed information of "Viewport"?

Discussion and feedback on Construct 2

Post » Wed Mar 23, 2016 2:04 pm

Can anyone give me a detailed information of "Viewport"? I really don't understand what it is? Thanks...
Also, can you explain it like you are talking to a kid that has no idea about this?
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,112
Reputation: 59,147

Post » Wed Mar 23, 2016 4:54 pm

Hi Chadorireborn,

I've a fairly strong web developer background where a viewport is basically the visible area of a webpage for a user. So for example, a page displayed on an iphone in landscape would provide a completely different area to play with than a 28" mac pro in safari.

I haven't used them in my construct 2 projects yet but I would imagine it is the same.

Basically it is a way of making sure people iwth different size screens all see the same thing, or atleast what you want them to :)

Hope this helps
B
7
Posts: 20
Reputation: 317

Post » Wed Mar 23, 2016 4:57 pm

It's basically just the view you have of your layout. If your layout was drawn out on the ground, and you looked at it through a camera. The camera would be the viewport.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Wed Mar 23, 2016 5:33 pm

I see, but I do not understand how to apply it. Can you please give me an example situation or .capx that viewport can be used? If it isn't too demanding :D .
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,112
Reputation: 59,147

Post » Wed Mar 23, 2016 6:14 pm

There's nothing to it. Any capx would work. What you see is the viewport.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Wed Mar 23, 2016 10:52 pm

Are you familiar with the window size? It determines how much of your layout you see at a time. The window can move around with the scrollto action. The viewport expressions gives you the positions of each side of your window within the layout.

What you do with this position information is up to you.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests