Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BAM: Thinking about adding a SCROLL statement
#11
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!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#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
#13
Sanity testing programs:

Scrolling horizontally, -1 and +1:

Scrolling vertically, -1 and +1:
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)