Why does this switch out of graphics mode when building sprite--code follows:
option base 1
option angle degrees
option sprite pos central
graphics clear 1,1,1
graphics
gosub Spiralx
gosub DisplaySpiral
end
Spiralx:
cx=42!cy=46
option angle radians
draw alpha 1
sprite "spiral" begin 2*cx,2*cy
draw to cx,cy
draw color 1,0,0
draw size 4
shadow on
a=.02
for t = 0 to (6.28 * 5) step .008
x =a*t * cos(t)
y = a*t * sin(t)
draw line to cx+x ,cy+y
a=(a+.0004)
next t
sprite end
return
DisplaySpiral:
sprite "spiral" show
for i = 1 to 360
sprite "spiral" at 400,400 angle i
pause .2
next i
return
Graphics mode
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Graphics mode
There is only one graphics mode. So smart BASIC does not "switch out" of it - graphics mode switches to drawing sprite with command SPRITE BEGIN and then returns to main graphics window with command SPRITE END.
Re: Graphics mode
I guess I mean it seems to switch to text view to draw sprite and then as you say switches back to graphics window when reaching sprite end.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Graphics mode
So why do you think it goes to text view to draw sprite?
Re: Graphics mode
When program runs graphics window starts out all white
Then when sprite starts to build, view changes to the papyrus view then
When sprite end is reached window goes back to white with sprite on it
Why does the papyrus view show when draw command starts??
Then when sprite starts to build, view changes to the papyrus view then
When sprite end is reached window goes back to white with sprite on it
Why does the papyrus view show when draw command starts??
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Graphics mode
At first you clean main graphics window to white with GRAPHICS CLEAR command.
Then you switch to main graphics view with GRAPHICS command - you see white background.
Then you begin drawing sprite, this switches graphics view to fresh and clean graphics window - you see papyrus background of empty graphics window.
Then you end drawing sprite, this switches graphics view back to main graphics window.
Then you switch to main graphics view with GRAPHICS command - you see white background.
Then you begin drawing sprite, this switches graphics view to fresh and clean graphics window - you see papyrus background of empty graphics window.
Then you end drawing sprite, this switches graphics view back to main graphics window.