Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Sprite as a Background (Game Maker)


Mr.S

Recommended Posts

You mean use a sprite as a background? I assume it's animated, otherwise you might as well make it a background (by simple copy and pasting). Anyway, you can draw a sprite tiled onto the entire room using the functions:

draw_sprite_tiled(sprite,subimg,x,y) Draws the sprite tiled so that it fills the entire room. (x,y) is the place where one of the sprites is drawn.

draw_sprite_tiled_ext(sprite,subimg,x,y,xscale,yscale,color,alpha) Draws the sprite tiled so that it fills the entire room but now with scale factors and a color and transparency setting.

Just put that in the draw event on an object with a really high depth and it's more or less a background.

Edit: There are ways you can scroll through backgrounds, so to speak, but I don't think it makes much difference for speed or memory.

Link to comment
Share on other sites

To make it stay in the middle of the room, you draw it with the view's xview and yview as the coordinates:

draw_sprite_tiled(bg_sprite,-1,view_vxiew[0],view_yview[0]);

Or, for a bit of paralax, you can multiply the x and yview by some number between 0.5 and 1.5 or so to get a psuedo-genesis effect:

draw_sprite_tiled(bg_sprite,-1,view_vxiew[0]*0.9,view_yview[0]*0.9);

Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...