Mr.S Posted June 8, 2006 Report Share Posted June 8, 2006 I need to set a sprite as a background. The sprite is: Width = 319 and height = 223. How could i set this as a background. thanks Link to comment Share on other sites More sharing options...
Kain Posted June 8, 2006 Report Share Posted June 8, 2006 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 More sharing options...
Mr.S Posted June 8, 2006 Author Report Share Posted June 8, 2006 Thanks but im using a animated sprite. Its for a sonic game. I forgot to mention that the background needs to stay in the middle of the room. Click here to view my background Link to comment Share on other sites More sharing options...
Kain Posted June 8, 2006 Report Share Posted June 8, 2006 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 More sharing options...
revolutiongames2004 Posted June 29, 2006 Report Share Posted June 29, 2006 you know you could just make the sprite into an object and in the step event x=player.x y=player.y also in the sprite, click center maybe i misinterpreted, do you want it to look like the death egg act 1 background? Link to comment Share on other sites More sharing options...
Recommended Posts