SPRITE_BRIGHTNESS

SPRITE_BRIGHTNESS N,V

CHANGES THE BRIGHTNESS OF THE SPRITE NUMBER N

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

ACTION

The command SPRITE_BRIGHTNESS N,V changes the brightness of the SPRITE designated by its number N.

Every time the command is executed:

- if V=0, the SPRITE remains unchanged,

- if V<0, its brightness decreases,

- if V>0, its brightness increases.

Remark : V must be between -128 and 127.

SYNTAX: SPRITE_BRIGHTNESS N,V

  • N = SPRITE number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of SPRITE objects.
  • V = brightness value.

USE

  • The command SPRITE_BRIGHTNESS is used to change the brightness of a SPRITE.

ERROR

  • IIf number N is not a correct expression.
  • If number N exceeds the allowed maximum number of SPRITE objects.
  • If number N is not greater than 0.
  • If the SPRITE number N does not exist.
  • If V is less than -128 or greater than 127.
  • If V is not a correct expression.

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 load a picture to the SPRITE

sprite_file_load 1,"alien.bmp"

rem wait for 1 seconde

wait 1000

rem increase its brightness

sprite_brightness 1,10

SEE ALSO

SPRITE_CONTRAST

SPRITE_GAMMA