resizable interface according to the screen size?

0 favourites
  • 6 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • Hello everyone!

    Well, i recently saw a lot of games using this style of interface but i dont really know how to get a interface that always stays in the corners of the screen, the only interface i know how to do is a layer with parallax in 0,0 but i know that there is a way to do this:

    (red dots are the interface)

    <img src="http://i.imgur.com/cYluegp.png" border="0" />

    Does someone know how to do that?

  • Hi,

    i think its calulating the x,y positions of the interface objects according to the "WindowWidth" and "WindowHeight" system variables.

    For example:

    positioning the right top object to:

    y: YOffset

    x: WindowWidth - ObjectWidth - XOffset

    Where as the offsets define how far from the edge the object should be

    Same goes for the others:

    right bottom:

    x: WindowHeight - ObjectHeight - yOffset

    y: WindowWidth - ObjectWidth - XOffset

    left top:

    y: yOffset

    x: xOffset

    left bottom:

    y: WindowHeight - ObjectHeight - yOffset

    x: xOffset

  • Construct2 has the anchor-behaviour for this..

  • thanks! i ll try to do it by the 2 methods :)

  • it works! thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    i think its calulating the x,y positions of the interface objects according to the "WindowWidth" and "WindowHeight" system variables.

    For example:

    positioning the right top object to:

    y: YOffset

    x: WindowWidth - ObjectWidth - XOffset

    Where as the offsets define how far from the edge the object should be

    Same goes for the others:

    right bottom:

    x: WindowHeight - ObjectHeight - yOffset

    y: WindowWidth - ObjectWidth - XOffset

    left top:

    y: yOffset

    x: xOffset

    left bottom:

    y: WindowHeight - ObjectHeight - yOffset

    x: xOffset

    i got a question,

    what means XOffset and YOffsets?

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