0 Favourites

How do I scale a background to follow layout size?

  • I'm using a Tiled Background to load an image from external source. It's all working well except there's seems to be not a single option to scale the image. If I pick an image which is larger than layout's size, the rest will simply cropped out. Is there any option like "Fill" or "Fit" the image to correspond with smaller layout size?

  • Bump, looking if anyone have any ideas.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • As you can see in the manual article about the TiledBackground object.

    The object is there to display the repetitive texture that has been loaded into it.

    So no, no stretch or fit of the texture, those only happen in the Sprite object.

    A way to "cheat" could be to have the TiledBackground on its own layer. As you know the size of the layout and you know the size of the image loaded in the object once it is loaded (expression ImageWitdth, ImageHeight) you can calculate the ratio of those and set accordingly the Layerscale and TiledBackground size so that it covers the layout and still appears with the correct "scale".

  • As you can see in the manual article about the TiledBackground object.

    The object is there to display the repetitive texture that has been loaded into it.

    So no, no stretch or fit of the texture, those only happen in the Sprite object.

    A way to "cheat" could be to have the TiledBackground on its own layer. As you know the size of the layout and you know the size of the image loaded in the object once it is loaded (expression ImageWitdth, ImageHeight) you can calculate the ratio of those and set accordingly the Layerscale and TiledBackground size so that it covers the layout and still appears with the correct "scale".

    Makes sense, I will try this. Thank you so much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff
Unread hot topic
132 29,587
chadorireborn's avatar
chadorireborn
Unread hot topic
52 8,562
BluePhaze's avatar
BluePhaze