• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with Background Sprites, tile and scale.

Z

Zekidan

Guest
Hey im new to game maker and I am wondering if there is a simple way to both horizontally tile a sprite while also being able to adjust the image_yscale of the same sprite in a background layer, in the step event?

I want the sprite to tile horizontally so that it is indefinite, however i want it to scale vertically based on the camera’s zoom creating a 3d effect.

however the problem is I'm having a hard time finding a function to scale the background sprite in game.

Perhaps I should use an object instead?
 

curato

Member
that really depends on the sprite. The more your want to stretch or wrap it, the more simple you are going to want the sprit to be. A high detail sprite will most likely look bad all stretched.
 
Z

Zekidan

Guest
that really depends on the sprite. The more your want to stretch or wrap it, the more simple you are going to want the sprit to be. A high detail sprite will most likely look bad all stretched.
I didnt ask how it would look, or advice on how to make things look good. I asked can it be done, and how to do it? No where did i ask will this look good? I know how it will look. Thank you
 

chamaeleon

Member
After selecting horizontal tiling for a background, a helper object to do something every step
Create event
GML:
counter = 0;
Step event
GML:
var layer_id = layer_get_id("Background");
var background_id = layer_background_get_id(layer_id);
layer_background_yscale(background_id, (2+dsin(counter)));
counter++;
As the sprite is not tiled vertically, you might need a second background layer under the scaling one to help clear the view every step (or you get remnants from the scaling layer when it is smaller than the previous step).
 
Z

Zekidan

Guest
After selecting horizontal tiling for a background, a helper object to do something every step
Create event
GML:
counter = 0;
Step event
GML:
var layer_id = layer_get_id("Background");
var background_id = layer_background_get_id(layer_id);
layer_background_yscale(background_id, (2+dsin(counter)));
counter++;
As the sprite is not tiled vertically, you might need a second background layer under the scaling one to help clear the view every step (or you get remnants from the scaling layer when it is smaller than the previous step).
Thank you definitely will try it!!
 
Top