TI99 Environment

# CALL_COLORSPRITE

Syntax

CALL_COLORSPRITE(sprite-number,foreground-color)

Description

The CALL_COLORSPRITE() function allows changing the foreground color of an active regular sprite. The background-color of a sprite is always transparent. The function will ignore any changes to multicolor sprites. Valid Values: sprite-number: accepts an integer between 1-maxsprites. foreground-color: accepts an integer between 1-16.

Example Code

    Example 1:
    randomize hitimer()
    call_screen(5)
    display_at(24,1,"press a key to change color",0)
    call_magnify(2)
    call_sprite(1,65,rnd(13)+3,96,128,0,1)
    do
       tiwaitkey()
       a=rnd(13)+3
       CALL_COLORSPRITE(1,a)
    loop

    Example 2:
    scrn = 3
    call_char(129,rpt$("f",16))
    call_char(128,rpt$("f",16))
    for i = 1 to 16
       call_sprite(i,128,2,100,i * 12,0,0)
    next
    do
       call_hchar(13,1,129,64)
       for i = 1 to 16
          CALL_COLORSPRITE(i,scrn)
          call_colorchar(129,scrn,scrn)
          tiwait(50)
       next
       inc scrn
       if scrn > 16 then scrn = 3
    loop

Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020