SPRITE_GAMMA

SPRITE_GAMMA N,V

CHANGES THE GAMMA OF THE SPRITE NUMBER N

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

ACTION

The command SPRITE_GAMMA 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 gamma decreases,

- if V>0, its gamma increases.

Remark : V must be between -128 and 127.

SYNTAX: SPRITE_GAMMA 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 = gamma value.

USE

  • The command SPRITE_GAMMA is used to change the gamma of a SPRITE.

ERROR

  • If 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 gamma

sprite_gamma 1,10

SEE ALSO

SPRITE_CONTRAST

SPRITE_BRIGHTNESS