|
Post by tsh73 on Sept 22, 2023 18:39:22 GMT
You should already know that drawing operators of Just / Liberty BASIC are passed to a graphicbox / graphic window as text. Plain text, readable by humans. That might be slow - window should interpret commands from strings. But that gives some possibilities other languages do not have.
Have you seen printform.bas example? 62 lines of graphic commands, not counting inner loop that draw labels/boxes
Any drawing command looks like
#form "place 1 471" - like a text printed to #form !
Now, watch my hands I take source program printform.bas And change
open "Printable Form" for graphics as #form to
fileName$="data01.txt" open fileName$ for output as #form , and instead of sending stuff to printer
confirm "Send to printer?"; answer if answer then #form "print svga" I close this file and run it in notepad
close #form run "notepad.exe "+ fileName$ I got some 85 lines, like this (first fiew)
down backcolor 220 220 220 size 2 place 1 1 ; boxfilled 700 110 font arial 16 bold place 20 34 \Software Mail-in Order Form These lines are drawing commands. And now they are in a file, separated from a program!
Now if we read that file line-by-line and feed that ionto graphicbox/graphic window, we recreate that print form on a screen.
And whole code (engine!) will be just that
nomainwin WindowWidth = 800 WindowHeight = DisplayHeight open "Printable Form" for graphics as #form fileName$="data01.txt" open fileName$ for input as #inFile #form "trapclose [quit]"
while not(eof(#inFile)) line input #inFile, aLine$ #form aLine$ wend close #inFile
#form "flush" confirm "Send to printer?"; answer if answer then #form "print svga" wait end
[quit] close #form end
Looks cool for me.
|
|
|
Post by cundo on Sept 23, 2023 19:56:19 GMT
Ah I see !!! an interpreter of graphics commands that are stored in a text file. Useful to update programs in Exe format.
|
|
|
Post by plus on Sept 23, 2023 22:31:44 GMT
very interesting
b = b + ...
|
|
|
Post by Enzo on Oct 13, 2023 22:44:13 GMT
Ah I see !!! an interpreter of graphics commands that are stored in a text file. Useful to update programs in Exe format. I've considered this type of method for my game ive been making, maybe even user created sprites at some point. This could be used to create a ide editor color based with hiding the controls and using input variable.
|
|