Change layout size at runtime

0 favourites
  • 10 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • I would love to do this, change layout size at runtime so it will match the level automatically generated. I do not want the screen to scroll beyond the automatic generated level size. It is apparent at right side and bottom side. As the level generation start at topleft corner.

    It could be bound to a certain condition so it will just be executed at the very loading of layout?

  • I'm not sure if this is possible, but you could enable unbounded scrolling and just clamp the scrollX ans scrolly according to the level layout?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am after this too. Anyone know how to change the layout size during runtime so that I can have different layout sizes?

  • Sorry forgot to reply to my own thread.

    I asked here in this forum because I would like to see it actually be added to C2.

    Have anyone tried the unbounded scrolling + clamp?

  • Yep, do it all the time. Just enable unbounded scrolling and use 9-patches or something to define the layout.

  • Somebody

    Nevermind, read next reply.

    (removed bla bla bla)

  • [attachment=0:3acg1eaj][/attachment:3acg1eaj]

    Here's how I did it. (I guessed the numbers and it is correct for the level I am working on)

    For other people wanting to use this: substitute the "smoothplayercam" for your sprite that you want to "follow".

    do not forget disable/delete "Scroll To" behavior.

    I need to go back to bed, but tomorrow I will figure out how to make the numbers dynamic so it will reflect

    for different level sizes.

    This should be turned into a tutorial!

    Thanks!

  • [attachment=0:33esttbz]scroll.jpg[/attachment:33esttbz]

    So there, now I made the numbers dynamic.

    I wonder if you can help me verify that the level stays within its border (the chocolate border) and no white is seen nor it is too small.

    Compare level 1 with T2.

    http://www.funnybunny.se/game/

    Somebody - if you have time. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I hope this solution will work and not that it will eff up depending on which browser/system you use.

  • Somebody - if you have time.

    I hope this solution will work and not that it will eff up depending on which browser/system you use.

    That cracked me up given all the cuteness in this project

    Seems to work perfectly. It shouldn't be affected by browsers or anything, since the scrolling logic is entirely up to C2. As long as the numbers are correct it should be as well.

  • Somebody

    Awesome, thanks.

    Ah the eff... I limited myself from fuck. Cuteness mixed with profanity!

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