draw_sprite(sprite,subimage,x,y)

Drag & Drop equivalent : GM108

 

Note: This function must be placed in the Draw Event for it to work correctly.

 

sprite = The name of the sprite you want to draw. This is the name you gave it when you created the sprite resource.

subimg = This is the frame of the animation you want to draw.

x = This is the horizontal position of the sprite, in pixels.

y = This is the vertical position of the sprite, in pixels.

 

Example

draw_sprite(spr_player,-1,100,100);

 

When you place anything in the Draw Event of an object, you'll find the sprite of that object disappears from the screen, in order to rectify this, you can use draw_sprite in the Draw Event to draw the player sprite again.

 

Placing an animation frame number in subimg will just draw that single frame. In order to animate, you put -1 in here. The numbering for frames starts at 0, so your first frame will be frame 0, hence, if you want to display frame 3, you would place the number 2 (0, 1, 2).

 

Flashback - Revision #1