How do I scale a background to follow layout size?

Get help using Construct 2

Post » Fri Jan 13, 2017 4:52 pm

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?
B
28
S
8
G
1
Posts: 19
Reputation: 2,245

Post » Tue Jan 17, 2017 4:42 am

Bump, looking if anyone have any ideas.
B
28
S
8
G
1
Posts: 19
Reputation: 2,245

Post » Tue Jan 17, 2017 8:52 am

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".
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Tue Jan 17, 2017 4:25 pm

Kyatric wrote: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!
B
28
S
8
G
1
Posts: 19
Reputation: 2,245


Return to How do I....?

Who is online

Users browsing this forum: bluesun66, jasontoups, Yahoo [Bot] and 1 guest