10-29-2024, 01:52 PM
the most simplistic thing to do would be to copy the section of screen that the text box will go over. this also assumes your text box is an image itself,
This code makes a lot of assumptions of how you are storing and using your text box and how fast you want it to scroll in and out and makes no attempt in controlling screen flickering.
You could also us a DO:LOOP as well if you don't like FOR\NEXT.
You can change how much of the text box is shown\removed with STEP, and how fast\slow with _LIMIT or even _DELAY.
I see B+ just made you some code too. Beat me to it.
Code: (Select All)
tempimagelayer = _NEWIMAGE( textboxXsize , textboxYsize, 32) 'temp area to store screen hidden by text box
_PUTIMAGE (0,0), _DISPLAY ,tempimagelayer, (ScreenPosX ,ScreenPosY)-step(textboxXsize -1, textboxYsize -1) 'move the section of screen to back it up
FOR Y%=0 TO textboxYsize-1 'Scroll out text box (this is from top down, for bottom up useĀ "textboxYsize -1 TO 0 STEP -1"
_PUTIMAGE (ScreenPosX,ScreenPosY + Y%), TEXTBOXLayer, _DISPLAY, (0,y%)-STEP(TextboxXsize-1,0) 'place textbox line by line onto screen
_LIMIT 30 'change value to speed up or slow down how fast the textbox is shown
NEXT Y%
'do textbox stuff
FOR Y%=0 TO textboxYsize-1 'remove text box with scroll (this is from top down, for bottom up useĀ "textboxYsize -1 TO 0 STEP -1"
_PUTIMAGE (ScreenPosX,ScreenPosY + Y%), tempimagelayer, _DISPLAY, (0,y%)-STEP(TextboxXsize-1,0) 'remove textbox from screen line by line.
_LIMIT 30 'change value to speed up or slow down how fast the textbox is removed
NEXT Y%
This code makes a lot of assumptions of how you are storing and using your text box and how fast you want it to scroll in and out and makes no attempt in controlling screen flickering.
You could also us a DO:LOOP as well if you don't like FOR\NEXT.
You can change how much of the text box is shown\removed with STEP, and how fast\slow with _LIMIT or even _DELAY.
I see B+ just made you some code too. Beat me to it.