How do I cut off edges on Unbounded Layout?

Get help using Construct 2

Post » Mon Oct 24, 2016 9:33 am

So if I set unbouded layout I end up with white margins at the edge of the screen. I don't know exactly how to fix this
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Mon Oct 24, 2016 2:34 pm

Use Scale Inner or Scale Outer layout "Fullscreen in browser" setting.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Thu Oct 27, 2016 12:49 pm

gumshoe2029 wrote:Use Scale Inner or Scale Outer layout "Fullscreen in browser" setting.


Doesnt work. My screen size is 320x200.

Here's Bounded:

Image

Here's Unbounded Scrolling:

Image

I want to avoid those edges happening.
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 2:46 pm

That's what unbounded scrolling will do, it scrolls past the layout edges so it shows what's outside the layout. Since there's nothing, you simply see your background layer color, which is white from your screenshot. Simply add backgrounds outside the layout or change the color of your layer to your liking so it's not white.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Thu Oct 27, 2016 3:47 pm

Magistross wrote:That's what unbounded scrolling will do, it scrolls past the layout edges so it shows what's outside the layout. Since there's nothing, you simply see your background layer color, which is white from your screenshot. Simply add backgrounds outside the layout or change the color of your layer to your liking so it's not white.


I've seen a couple of unbounded scrolling games and they restrict the edges.
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 4:09 pm

The whole point of unbounded scrolling is to ignore the layout edge restriction. What exactly are you trying to accomplish ? Do you want unbounded vertical scrolling but bounded horizontal one ?
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Thu Oct 27, 2016 4:12 pm

Magistross wrote:The whole point of unbounded scrolling is to ignore the layout edge restriction. What exactly are you trying to accomplish ? Do you want unbounded vertical scrolling but bounded horizontal one ?


To be honest I was just testing out stuff. I guess there's no reason for unbounded scrolling for my game, is just a simple platformer, just wanted to avoid having to set layout size for each level..
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 4:28 pm

I guess it could work if you scroll with events instead of the scrollTo behavior.

Code: Select all
Every tick :
    Scroll to position : X: max(Sprite.X, OriginalWindowWidth/2)
                         Y: Sprite.Y


With the layout set to unbounded scrolling, this would effectively make it so the scrolling is only bounded by the left edge.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Thu Oct 27, 2016 4:47 pm

Magistross wrote:I guess it could work if you scroll with events instead of the scrollTo behavior.

Code: Select all
Every tick :
    Scroll to position : X: max(Sprite.X, OriginalWindowWidth/2)
                         Y: Sprite.Y


With the layout set to unbounded scrolling, this would effectively make it so the scrolling is only bounded by the left edge.


Will try it out but in your experience would you recommend bound scrolling for my needs?
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 4:57 pm

I guess in the end it doesn't make much of a difference, apart from the fact that you could ignore adjusting each of your layout's size, as you mentioned.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000, Kin and 32 guests