Layer/Object stretch to fit screen

Is it possible to just have one layer or object stretch to fill the screen. For example square object somewhere in screen. Have a background image/object. And to fit the screen only the background image stretches not the square.

Also important to note it should increate the game size. Basically to fit all screens.

You can choose the object you want stretch by using scale.

but it needs to fit the screen. so basically one layer is staying the same.and one layer stretches to fill the screen.

effectively changing game size

Check if the object is in layer you want and apply scale to it.
You cannot change layer size. It has the same size of your game.

is it possible to change game size with actions

Why do you want to do that? It makes no sense changing game size during the game.

to fit the screen of the phone

There’s an action under Games’s window to activate full screen mode.

yes but that will give black borders. I want the screen to be filled completely

So i want the green (background layer) to scale depending on the screen size.
so i dont get any black borders.

Set full screen yes and keep aspect ratio no.

then it stretches the objects/scene

Project Manager > Game Settings > Properties > Fullscreen/game size mode:

11

Select “change width to fit the screen” or “change height to fit the screen”.

1 Like

Yeah I know but the the thing is different aspect ratios. So what i would want is not to have the black sidebars.

One layer that can expand to fill the screen. for example a background layer. Most apps and games fit on all types of screens. But now it only fits to your specific aspect ratio of your game. Is there no dynamic way you can fix this?

so 16:9 ratio to 16:10 just the background stretches but not the rest of the objects

you can change the resolution with actions (the game window’s size). you can find some details on wiki about this. than you can put bigger background to your scene than the biggest resolution than you enable. doesn’t need new layer to this. or set up different size for different layers.

this also stretches the objects out of proportion

no. it isn’t. if you choose the “no stretch” option. this method will grow or shrink the play area.

1 Like

what i get then is a blank space on one side and black bars top and bottom