SPRITE_IMAGE_LOAD

SPRITE_IMAGE_LOAD N1,N2

LOADS THE PICTURE FROM THE OBJECT NUMBER N2 TO THE SPRITE NUMBER N1

  • Type: Command
  • Parameters: 2
  • Group: SPRITE

ACTION

The command SPRITE_IMAGE_LOAD N1,N2 loads the picture from the object number N2 to the SPRITE number N.

SYNTAX: SPRITE_IMAGE_LOAD N1,N2

  • N1 = SPRITE number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of SPRITE objects.
  • N2 = IMAGE number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • The command is used to load a picture from an IMAGE object to a SPRITE.

ERROR

  • If number N1 is not a correct expression.
  • If the IMAGE number N1 does not exist.
  • If number N2 is not a correct expression.
  • If the SPRITE number N2 does not exist.

EXAMPLE

rem create a 2D world number 1

scene2d 1

rem load a background picture

file_load 1,"city.bmp"

rem create a SPRITE number 1

sprite 1

rem create an IMAGE number 2

image 2

rem grab the screen

2d_image_copy 2,0,0,100,100

rem load this picture to the SPRITE

sprite_image_load 1,2

SEE ALSO

SPRITE

2D_IMAGE_COPY

2D_IMAGE_PASTE