Does margins effect..

Get help using Construct 2

Post » Fri Mar 21, 2014 3:46 pm

Do margins effect the way the layout is displayed on a mobile device as at the moment I have been exporting using cocoonjs and crosswalk to test and they both come out perfectly height wise but on the width there is a 1cm gap line on the right side of screen where u can see the goings on behind the game level.

my margins are set to H- 500, W- 500

My layout size is 1024 - 576, I set it to this so it is 16:9 ratio to hopefully support more screen sizes.
B
5
S
2
Posts: 105
Reputation: 837

Post » Fri Mar 21, 2014 3:55 pm

From the manual:
Margins
The size, in pixels, of the margins. The margins are the grey areas outside the layout area. This only affects the Layout View and has no effect when previewing.


So they seem to only be a workplace decoration. ;)
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Fri Mar 21, 2014 9:43 pm

Ye the part which threw me when I read the manual was where is says it only affects the layout view and had no effect when previewing, but didn't know if that meant it still effected it when exported.

Ok thanks for the reply it may be down to something else then. :)
B
5
S
2
Posts: 105
Reputation: 837

Post » Fri Mar 21, 2014 9:56 pm

Do you know what the aspect ratio of your mobile device is? If it's a 16:10 and your project gets scaled to match the height it looks like there would be a gap similar to what you mentioned.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Sat Mar 22, 2014 12:27 am

ye the device uses a 16:9 ratio, also if the ratio was wrong wouldn't there be gaps on both sides of the screen not just the one side.
B
5
S
2
Posts: 105
Reputation: 837

Post » Sat Mar 22, 2014 12:58 am

It seems like the gaps should appear on both sides. I recall reading something about settings that cause the layout to be drawn from the upper left, but of course I can't find it now.

I was re-reading through this tutorial and it sure sounds like it's an issue of aspect ratio: (Other than the gap is on one side.)
https://www.scirra.com/tutorials/73/sup ... reen-sizes

This is the same problem faced by TV producers. There are many TVs out there using aspect ratios of 4:3, 16:9 and 16:10. If a producer films a TV show only in 4:3, on a 16:9 TV there will be gaps at the sides, or possibly even unintended off-set equipment and crew visible! Similarly, if you draw a background exactly fitting one display, then run it with Scale outer mode on another display with a slightly different aspect ratio, gaps will appear at the side or content outside the layout becomes visible. This can even happen if you simply don't take in to account the space taken up by the status bar on devices like the iPhone.

There are two ways to solve this problem:
1) Use Scale outer mode, and draw your backgrounds wider (or taller, depending on orientation) than the window size, past the normally viewable edges, to ensure no gaps ever appear regardless of the device aspect ratio.
2) Use Scale inner mode, and make sure nothing important is close to the edges, since the edges are susceptible to being cut off on different size displays.


You might try the solutions offered just to see if it changes anything.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Sat Mar 22, 2014 1:14 am

Thanks for finding the above^ I will try the solutions.

One thing that is weird is its not just a black bar on the one side you can actually see through it like as if the viewport is overlapped the layout so you can see behind the level.

But I swear on older versions of construct you could change the viewport width and height, as well as layout size but I may be wrong.
B
5
S
2
Posts: 105
Reputation: 837

Post » Sat Mar 22, 2014 1:38 am

You still can. Which led me to this:
layer.viewLeft
layer.viewRight
layer.viewTop
layer.viewBottom
Defines the rectangle of the currently visible viewport. This may be larger or smaller than the canvas size if the scale is not 1.0.


You don't have a scale set to below 1.0 do you?
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Sat Mar 22, 2014 1:41 am

ah now that I didn't know I will check this now I think this may be the problem.

Thanks
B
5
S
2
Posts: 105
Reputation: 837

Post » Sat Mar 22, 2014 2:59 am

Worked a treat!

Think I accidentally set the scale below 1.0, its all ok now, much appreciated for all your help!
B
5
S
2
Posts: 105
Reputation: 837

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests