How do I use scale inner better (so close)

0 favourites
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • 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.

    this looks perfect!

    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

  • 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.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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..

  • 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!

  • 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.

  • 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..

  • The layout doesn't change, you set it's size manually, per layout. It's the ViewPort that changes size.

  • 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!

  • 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.

  • Quick hack idea, open up an image with outlines of the resolutions you are targeting in a tab. Resize briefer window to fit the lines, change tabs to your game.

  • Chrome has a "Window Resizer" plugin that lets you do things like that.

  • interesting suggestions. i'm not sure how to use that plugin but i'll look into it and oosyrag yea that's not a bad quick/dirty idea either.

  • holy crap that's awesome! ty!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)