How do I use scale inner better (so close)

Get help using Construct 2

Post » Mon Apr 11, 2016 2:05 pm

Hi everyone,

So I have this project that I want to try to get to be full screen on ipads and iphones, but the 4:3 to 16:9 issue is a challenge..

I've made a project that is portrait at 640x1136 (iphone 5/5s) and i'm using scale inner. for the iphone it looks perfect.. and using pin/anchors I thought ipad would look good but it seems to do something weird.. as i vertically compress the screen.. the object i have pinned to the button of the screen isn't moving up as I would think it would.

I'm not sure why.. this is what i see.

Image
this looks perfect!

Image
not so much..

in my mind i feel like the bottom of the screen is the bottom edge of the browser and as I resize the window i would imagine that it would stay anchored to the bottom of the screen but it doesn't.

just so you know more about the behind the scenes.. the white box has all of those other objects pinned to it.. so the only object i'm trying to anchor to the bottom is the white box.. everything else moves with it..

there must be something simple I'm leaving out.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Tue Apr 12, 2016 1:39 am

bump.. seriously.. why would the item that's anchored to the bottom of the screen and set to the bottom of the screen, not move with the bottom of the screen? it's like it's out of sync with it? how do i get an object to stay locked to the actual bottom of the visible screen? because anchor and pin are not working.
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Tue Apr 12, 2016 2:06 am

Are you sure your white box isn't pinned to anything? Have you tried isolating and simplifying your project to a point where it does work as expected?
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Tue Apr 12, 2016 4:08 am

hmmm yea even in a simple situation it works the same.. it's scale inner that seems to be the issue.. something about how it works that doesn't respect anchor..

https://dl.dropboxusercontent.com/u/6999242/capx/anchor%20test%201.capx

open it.. run it.. drag around your window size and watch the purple box drop off the bottom of the screen.. i'm trying to prevent this from happening..

i'm trying to make a portrait game look full screen on ipad and iphone.. I tried scale outer and it seemed to be much weirder..
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Tue Apr 12, 2016 6:28 am

Hey there,

Scale Inner has it's limitations, unfortunately ( https://www.scirra.com/tutorials/73/sup ... age-1#h2a6 ). You may want to run an event on start of layout that checks for the window width and height, and scale your items accordingly. I don't have tons of experience at this point and certainly none on mobile platforms but maybe this can help (substituting the resolution parameters for the current window size): https://www.scirra.com/tutorials/1258/c ... resolution

Hopefully this is helpful. Best of luck!
B
69
S
40
G
24
Posts: 356
Reputation: 18,314

Post » Tue Apr 12, 2016 6:42 am

I haven't gotten to experiment with your capx yet, but had an idea.

Have you tried positioning manually using ViewportBottom+whitebox.height? Instead of using the anchor behavior.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Tue Apr 12, 2016 11:31 am

@oosyrag i have not tried that but it doe sound interesting.

@ultrafop thanks i'll experiment more today.

I did do some realtime checking "if layouthight is < x" and that didn't seem to work..
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Tue Apr 12, 2016 2:26 pm

The layout doesn't change, you set it's size manually, per layout. It's the ViewPort that changes size.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Tue Apr 12, 2016 5:29 pm

ah ok viewport! that's what i need. yes already i'm doing some testing and i can see viewport will move things around based on current size which is just what i needed. this is a big help!
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Tue Apr 12, 2016 5:57 pm

is there a way to set the actual browser size? I'd like to be able to honestly test screen sizes and it would be great if i could toggle between 640x1136 and 768x1024. Canvas size is something.. but that doesn't impact the actual viewport size.
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Next

Return to How do I....?

Who is online

Users browsing this forum: tannerdler and 6 guests