Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BAM: Thinking about adding a SCROLL statement
#12
(06-25-2023, 10:41 PM)bplus Wrote: When I said virtual screen, I meant a string array with all the lines to be projected onto the screen. Just run through the array index's one screen height at a time, starting at sequentially higher or lower index.

But you are doing great already!

Unless I'm missing something, I think I'm doing what you're saying.  Pardon the javascript, what I'm doing for vertical scroll:  (not pretty, but pretty is for later; all about wrapping my head around the mechanics of the wwwBASIC implementation)

Code: (Select All)
if (v < 0) {v=-v;
        for (var i = (v*display.width - 1); i < (display.width * display.height - 1); i++) {
           display_data[i-(v*display.width)] = display_data[i];
        }
        for (var i = ((display.width*display.height)-(v*display.width)); i < (display.width * display.height - 1); i++) {
           display_data[i] = bg_color;
        }
        }
        else if (v > 0) {
        for ( var i = (display.width * display.height - 1);i >= v; i--) {
           display_data[i] = display_data[i-(v*display.width)] || bg_color;
        }
        for (var i = 0; i < (v*display.width - 1); i++) {
           display_data[i] = bg_color;
        }
        }
Reply


Messages In This Thread
RE: BAM: Thinking about adding a SCROLL statement - by CharlieJV - 06-25-2023, 10:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  BAM Draw CharlieJV 9 2,053 11-07-2023, 10:27 PM
Last Post: James D Jarvis
  BAM: New version CharlieJV 0 505 06-29-2023, 02:22 AM
Last Post: CharlieJV
  BAM: SCROLL statement "super-test" CharlieJV 5 1,282 06-27-2023, 10:16 PM
Last Post: CharlieJV
  BAM and the CIRCLE statement CharlieJV 4 1,361 06-12-2023, 11:41 AM
Last Post: CharlieJV
  BAM App Personalizer (a GUI to personalize BAM programs) CharlieJV 0 496 01-06-2023, 03:48 AM
Last Post: CharlieJV

Forum Jump:


Users browsing this thread: 1 Guest(s)