Page 1 of 1

Graphics mode

Posted: Tue Nov 04, 2014 6:36 pm
by Dr zayus
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

Re: Graphics mode

Posted: Tue Nov 04, 2014 6:50 pm
by Mr. Kibernetik
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

Posted: Tue Nov 04, 2014 7:48 pm
by Dr zayus
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.

Re: Graphics mode

Posted: Tue Nov 04, 2014 7:56 pm
by Mr. Kibernetik
So why do you think it goes to text view to draw sprite?

Re: Graphics mode

Posted: Tue Nov 04, 2014 8:13 pm
by Dr zayus
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??

Re: Graphics mode

Posted: Tue Nov 04, 2014 8:19 pm
by Mr. Kibernetik
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.

Re: Graphics mode

Posted: Tue Nov 04, 2014 8:38 pm
by Dr zayus
I see--- thanks.