[CAPX INCLUDED] Scale layer to window size/viewport width?

0 favourites
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Ok..

    So what do you expect to happen, because what is happening is what is supposed to happen..

    The screen is scaled up in a way that the whole original project-size is on screen..

    There will be more than just that on the screen, because the aspect ratio of the window, makes the window's content surface bigger than the project..

  • Ok..

    So what do you expect to happen, because what is happening is what is supposed to happen..

    The screen is scaled up in a way that the whole original project-size is on screen..

    There will be more than just that on the screen, because the aspect ratio of the window, makes the window's content surface bigger than the project..

    LittleStain Exactly, that's what's great about that scaling mode is that it shows more onscreen. I just want to resize the HUD so it is scaled to the entire width of the window, whilst still retaining more viability for the rest of level to be seen. I'd then unscale it for the other modes.

  • You could set the width of the hud to viewportleft()-viewportright()?

  • You could set the width of the hud to viewportleft()-viewportright()?

    On the scale layer expression, I'm getting a syntax error with that first closed bracked ')', it's missing something?

  • > You could set the width of the hud to viewportleft()-viewportright()?

    >

    On the scale layer expression, I'm getting a syntax error with that first closed bracked ')', it's missing something?

    As outlined in the manual - those expressions require a 'Layer' component between the brackets.

  • >

    > > You could set the width of the hud to viewportleft()-viewportright()?

    > >

    > On the scale layer expression, I'm getting a syntax error with that first closed bracked ')', it's missing something?

    >

    As outlined in the manual - those expressions require a 'Layer' component between the brackets.

    Sorry, forgot that part! I can't find any layer component that works with this expression?

  • try 0, or 1, or "HUD"

  • try 0, or 1, or "HUD"

    HUD didn't work, 0 and 1 just made the HUD disappear?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > try 0, or 1, or "HUD"

    >

    HUD didn't work, 0 and 1 just made the HUD disappear?

    What is the event you used?

  • >

    > > try 0, or 1, or "HUD"

    > >

    > HUD didn't work, 0 and 1 just made the HUD disappear?

    >

    What is the event you used?

    Set layer scale?

  • Set layer scale?

    That is an action, but you set the layerscale to viewportleft(0)-viewportright(0) , so you set the layerscale to 500 or more?

  • >

    > Set layer scale?

    >

    That is an action, but you set the layerscale to viewportleft(0)-viewportright(0) , so you set the layerscale to 500 or more?

    Yes, I have it so that if that scaling mode is set (test for variable) then set the scale of layer to viewportleft(0)-viewportright(0). The capx is exactly as I have it setup, so if you can try anything that will resize that bluebar to the right width when scale outer is used (dynamically, not fixed, so it works on all aspect ratios), it would be solved! Like I mentioned, 1.3 is the right size for a 16:9 screen, but not for a 4:3 ratio.

  • Setting the scale of the layer to such an enormously high number isn't what you are after..

    If you set the width of the bar to viewportright()-viewportleft(), however..

  • Setting the scale of the layer to such an enormously high number isn't what you are after..

    If you set the width of the bar to viewportright()-viewportleft(), however..

    Yes, that would work, but I need not just that bar but the other items on the layer resized too, all of the score and life and health numbers. 1.3 isn't enormously high for a layer scale, it's only a third(ish) bigger. Can I scale a whole group of items so they're exactly the same relative size? If not, that's why I wanted to use a dynamic layer scale figure depending on the resolution of the players screen.

  • Setting the scale of the layer to such an enormously high number isn't what you are after..

    If you set the width of the bar to viewportright()-viewportleft(), however..

    LittleStain Is there a way of scaling a group of items so they relatively meet the correct width? Like I say, the bar will have many other items on it that need to be scaled relatively, which I was I was scaling the layer.

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