Letterbox Scale - Center

Discussion and feedback on Construct 2

Post » Thu Jul 04, 2013 8:24 am

I'm updating a few of my games on iTunes and one thing that's always bugged me is the black line to the right side of the ipad versions of the games. Or if I make the games to the ipad dimensions, then there is a black bar on the bottom of iphones.

I would love to find a solutions without the need to put out 2 different versions of the game, that way customers don't have to buy it twice.

Letterbox scale works great, except it doesn't center the layout. I know it does in browsers, but not on iOS devices.

I'm building my games with phonegap/xcode. Would this be a phonegap issue instead?

Same goes when trying to use inner or outer scale as well. Even those seem to favor the upper left corner, then filling in. Which makes sense I guess considering 0,0 is the upper left.

Anyone have any advice on this?

Thanks.ArcadEd2013-07-04 08:25:38
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Thu Jul 04, 2013 10:22 am

This shouldn't happen - all the fullscreen modes should be centered and based on the scrolling position. However we don't support using PhoneGap outside of PhoneGap Build, so you might have broken it yourself.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Thu Jul 04, 2013 2:15 pm

Could be. I'll start researching it from phonegap then. Thanks Ashley.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Fri Dec 06, 2013 7:05 pm

Hi. I hope its ok to post in this old topic. I have a problem with centering and scaling as well. I tried different options from the "Supporting multiple screen sizes" tutorial and it seems Scale Outer works best for me (want to publish it to iphone/android/desktop) but it seems to be aligned to the left side and not centered in full screen mode. Is centering only possible with letterbox mode?

When I add RequestFullscreen on Start of Layout and set it to "Center" it does not seem to do anything and it is still aligned left with a black bar on the right side.
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
56
S
17
G
6
Posts: 748
Reputation: 9,420

Post » Fri Dec 06, 2013 7:20 pm

@Bl4ckSh33p @ArcadEd

Dont forget about the parallax value. If you dont use it, just set it to 0,0. On start of layout just centered to your screen using scroll to.

After that it should be centered. I`m using Scale Outer and my games currently support fullscreen on Android (Galaxy S3) and Ipad 4.

For using scale outer, you have to make sure that the background is extra big than the window size. My window size is 320x480 but I have to make sure that the background fully covered my Ipad resolution.

Just put important game content in the 320x480 , on the outer maybe put trees , stone or something which dont effect gameplay. Kinda like framing a picture.

So far I , except my first two games I think all my newer game should be fullscreen and no black bar.

I just dont like letterbox scale and the black bars, and I dont understand why Scale Outer is kinda hated by people. :)
B
82
S
23
G
14
Posts: 389
Reputation: 12,504

Post » Fri Dec 06, 2013 7:35 pm

Yeah, this post is fairly old, I fixed the problem myself a while ago by creating larger layouts. Then using scrollX and scrollY to the center of the screen on layout start. That way I just use scale outer and no matter what device it's on, it's centered.

Maybe I will do a tutorial on it one of these days since it seems like I answer PMs on it pretty often :).
ArcadEd2013-12-06 19:37:31
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Fri Dec 06, 2013 8:19 pm

The layout scrolling bounds still apply when you use a scaling fullscreen mode. You might want to enable 'unbounded scrolling' in layout properties so it has the freedom to center the layout even when scaling it down to smaller than the viewport size.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Thu Jan 15, 2015 4:43 pm

It´s old, but I found the answer here. I don´t know if nowadays there is a beter way to do that:

- Layout propertie Unbound Screen: Yes
- Background image must be bigger than your project window size.
- Event: System > Set scroll X to LayoutWidth/2
B
18
S
4
G
1
Posts: 143
Reputation: 1,868


Return to Construct 2 General

Who is online

Users browsing this forum: technofou, TheFoXeletan and 1 guest