Post by tsh73 on Nov 28, 2020 15:18:55 GMT
So
I tried to make a segment for grid.
And made segment for empty.
So now I could redraw grid or redraw empty.
(I cannot CLS because it looks like it kills stored segments)
Then I made segment for drawn object.
Interesting but I could redraw empty (effectively clearing that),
and then redraw grid/ drawn stuff. In any order - they both transparent.
BUT
I want to be able to ADD to drawing objects.
But then I tried it, only last addition got to "stuff" segment.
(I wonder if I really could keep list of segment numbers in long sting and redraw all list??)
So I got screen (with old "stuff" and new drawn object), GETBMP/DRAWBMP, and flush THAT.
Now I have "stuff" with thing added. And I still could add a grid over it.
But not stuff over grid - after DRAWBMP, "stuff" is not transparent.
John (tenochtitlanuk),
I never head of that line ('Well I wouldn't start from here') before.
I googled and read (several explanations) and think - and I appreciate it.
I think this should be done as vector graphics, not as PAINT-like program.
I tried to make a segment for grid.
And made segment for empty.
So now I could redraw grid or redraw empty.
(I cannot CLS because it looks like it kills stored segments)
Then I made segment for drawn object.
Interesting but I could redraw empty (effectively clearing that),
and then redraw grid/ drawn stuff. In any order - they both transparent.
BUT
I want to be able to ADD to drawing objects.
But then I tried it, only last addition got to "stuff" segment.
(I wonder if I really could keep list of segment numbers in long sting and redraw all list??)
So I got screen (with old "stuff" and new drawn object), GETBMP/DRAWBMP, and flush THAT.
Now I have "stuff" with thing added. And I still could add a grid over it.
But not stuff over grid - after DRAWBMP, "stuff" is not transparent.
John (tenochtitlanuk),
I never head of that line ('Well I wouldn't start from here') before.
I googled and read (several explanations) and think - and I appreciate it.
I think this should be done as vector graphics, not as PAINT-like program.
'testing segments by tsh73, Nov 2020
'I think I could not use it. CLS destroys all segments!
'v.03: add stuff with GETBMP/DRAWBMP
nomainwin
BUTTON #gr.btn2, "redraw empty", [gridOff], UR, 20, 10
BUTTON #gr.btn1, "redraw grid", [gridOn], UR, 20, 10+30
BUTTON #gr.btn3, "redraw stuff", [stuff], UR, 20, 10+2*30
BUTTON #gr.btn4, "Add more stuff", [moreStuff], UR, 20, 10+3*30
open "segments test" for graphics_nsb_nf as #gr
#gr "home; down; posxy cx cy"
#gr "trapclose [quit]"
#gr "cls" 'kills all segments???
#gr "flush"
#gr "segment tmp"
nogrid = tmp-1
'grid segment
for i = 1 to 10
for j = 1 to 10
x=2*cx/11*i
y=2*cx/11*j
#gr "line ";x;" ";0;" " ;x;" ";2*cy
#gr "line ";0;" ";y;" " ;2*cx;" ";y
next
next
#gr "flush"
#gr "segment tmp"
grid = tmp-1
'drawn stuff segment
#gr "home"
#gr "circle 30"
#gr "circle 50"
#gr "box ";cx+100;" ";cy-70
#gr "up; turn 45; go 30; down"
#gr "\Hello"
#gr "flush"
#gr "segment tmp"
stuff = tmp-1
wait
[quit]
timer 0
close #gr
end
'----------------------------
[gridOff]
#gr "redraw ";nogrid
wait
[gridOn]
#gr "redraw ";grid
wait
[stuff]
#gr "redraw ";stuff
wait
[moreStuff]
'Wanted: to add more drawn objects to "stuff"
N=N+1
#gr "redraw ";nogrid 'so I redraw empty
#gr "redraw ";stuff 'and redraw old stuff
#gr "home" 'and then add new
#gr "turn 100; go 70"
#gr "turn 100; go 70"
#gr "turn 100; go 70" 'deliberatedly not closed
#gr "\\";N 'and with printed N
'but it stodes only last one ???
'so we do getbmp/drawbmp, then flush
#gr "getbmp bmp 0 0 ";cx*2;" ";cy*2
#gr "drawbmp bmp 0 0 "
#gr "flush"
#gr "segment tmp"
stuff = tmp-1
wait