Saturday, November 4, 2023

🖥 BAM Draw

BAM Draw is an in-the-works refactoring of a BAM program I created over a year ago.

I'll be using this post to track the progress of this effort.

To play with and/or view the latest version of BAM Draw, find that program in the development version of BASIC Anywhere Machine.

Please note:  BAM Draw saves your single drawing to browser local storage, so that you can edit the same drawing over multiple sessions.

2023-11-12 Version of BAM Draw (🎉 Project complete 🎉)

  • Run the program
  • View the source code
  • I switched the positions of the "quadruple hamburger" thingy down and the currently selected menu item.  When using a mouse, I don't want the mouse covering any part of the currently selected menu item when hovering over the "quadruple hamburger" thingy.
  • Otherwise, this version was about code refactoring and re-organizing.


2023-11-10 Version of BAM Draw

  • Run the program
  • View the source code
  • Added "MovL", "MovR", "MovU", "MovD" to items available via the "quadruple hamburger" thingy
    • These are meant to move the drawing, one row/column at a time, Left, Right, Up, or Down
    • Note that moving the drawing will cause the loss of a row or column; for example, moving the diagram left will:
      • overwrite the first column, with whatever is in the second column
      • whatever was in the first column no longer exists
      • so every column shifts to the left by 1
      • the right-most column will be blank
  • Also fixed bugs at programs "New drawing or continue previous drawing" prompt 


2023-11-08 Version of BAM Draw

  • Run the program
  • View the source code
  • Added "Xprt" to items available via the "quadruple hamburger" thingy.
  • "Xprt" will download the drawing as a BASIC program with the drawing in DATA statements, the DATA statements preceded by a very simple program that displays the drawing.
  • Also, this program includes a fix to the development version of BAM: the program console, when right-clicked and after closing the browser popup menu, the console was behaving as if the left mouse button was pressed and held pressed.  (See what happens, in the previous versions of this program, when you right-click on the drawing, then press the escape key on your keyboard to close the popup menu, and move the mouse around. )


2023-11-07 Version of BAM Draw

  • Run the program
  • View the source code
  • Will the program ever be complete?  Not as long as there are new features to add !  And not as long as I find code to refactor.
  • Let's say that the program is very functional.
  • I've reorganized the footer menu
    • Changed "Pen" label to "Marker" and moved it under the Background/Foreground clickable/touchable area
    • Clickable/touchable colours setup as two rows of 8 columns instead of one row of 16 columns, to take less horizontal space and allow for narrower drawings
    • The "F" and "B" labels (to indicate which colour is the foreground colour and which colour is the background colour now appear on top of the relevant colour.
    • Added a "quadruple hamburger" thingy which, when clicked, cycles through the available items displayed right below.  At startup, Grid is the available clickable item below the hamburgers thingy.  Next is "Wdth" (for width of the canvas), then "Hgth" (a typo there, for height of the canvas).
    • Tentative next feature:  export a drawing to a text file as a BASIC program with the drawing in DATA statements.



2023-11-06 Version of BAM Draw

  • Run the program
  • View the source code
  • This program is nearly complete
  • Click/touch colours in the footer menu to change brush colours
  • The colour applies to the pen component (either "Background" or "Foreground")
  • Click on the label "Background" or "Foreground" (whichever one is showing); this will toggle to the other pen component
  • The current pen Background and Foreground colours will be highlighted with "B" and "F" under the colours




2023-11-05 Version of BAM Draw

  • Run the program
  • View the source code
  • This program is now touch friendly
  • On startup, the program asks for width of canvas, then height of canvas
  • TUI (i.e. text user interface) menu bar setup as a footer on the screen
  • Pen can be chosen by clicking a key on a physical keyboard OR by clicking/touching the word "Pen" to open a prompt dialog (triggering virtual keyboards on touch devices)
  • Grid can be toggled on/off by clicking/touching the word "Grid"

 


2023-11-04 Version of BAM Draw


Usage Guide

  • Press a key on the keyboard to change the "brush" to that character
    • Set the brush to the "spacebar" character for erasing what's on the screen


    ASCII Draw


    Usage Guide

    • At the start of the program, answer the prompts for the size of the canvas
    • Click the word "background" to toggle between "background" and "foreground".
    • Click a color to set background or foreground color
    • Press a key on the keyboard to change the "brush" to that character
      • Set the brush to the "spacebar" character for erasing what's on the screen (using the currently selected background color)
    • Draw by individually clicking cells on the screen, or hold the click for continuous drawing as you move the mouse
     

     

     

    No comments:

    Post a Comment

    🖥 Fan Dance

    This is a port and mod of a SpecBAS program by ZXDunny. Run the program View the source code And, a "less is more?" version: Run t...