09-29-2023, 04:08 AM
I seem to be having issues with _SETALPHA.
When I initially set a color to a transparency level with _SETALPHA I can't change it to another transparency level later on.
I'm certain I've done this in the past.
I've found a work-around using a temporary image but I'm sure this is not needed ... or is it? See my code below and please explain to me why the first block of code is not working. A bug? Brain-fart on my part?
When I initially set a color to a transparency level with _SETALPHA I can't change it to another transparency level later on.
I'm certain I've done this in the past.
I've found a work-around using a temporary image but I'm sure this is not needed ... or is it? See my code below and please explain to me why the first block of code is not working. A bug? Brain-fart on my part?
Code: (Select All)
'|
'| Fade in a red box test
'|
DIM RedBox AS LONG
DIM TempBox AS LONG
DIM c AS INTEGER
SCREEN _NEWIMAGE(640, 480, 32)
RedBox = _NEWIMAGE(320, 240, 32)
_DEST RedBox
CLS , _RGB32(255, 0, 0)
_DEST 0
'c = 0 ' |
'DO ' | This block of code does not work?
' CLS ' |
' _LIMIT 30 ' | The Wiki shows however this should be acceptable
' _SETALPHA c, _RGB32(255, 0, 0), RedBox ' |
' _PUTIMAGE (159, 119), RedBox ' |
' _DISPLAY ' |
' c = c + 1 ' |
'LOOP UNTIL c = 256 ' |
c = 0 ' |
DO ' | This block of code does work.
CLS ' |
_LIMIT 30 ' | Why do I need to copy the original RedBox to
TempBox = _COPYIMAGE(RedBox) ' | to another image for every iteration of the loop?
_SETALPHA c, _RGB32(255, 0, 0), TempBox ' |
_PUTIMAGE (159, 119), TempBox ' |
_DISPLAY ' |
_FREEIMAGE TempBox ' |
c = c + 1 ' |
LOOP UNTIL c = 256 ' |