Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 View.Update?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bvbjules13




PostPosted: Wed Nov 21, 2012 7:40 pm   Post subject: View.Update?

What is it you are trying to achieve?
I am trying to make an animation

What is the problem you are having?
when the figure reaches near the end of the screen the animation drags, the rest of the animation if fine though. The animation in the code i have posted is a circle moving, but when it is almost off the screen it just stops, in other programs iv made to test this, they dragged, it seems that the animation is not getting cleared from the screen properly or something but i don't know

Describe what you have tried to solve this problem
used View.UpdateArea also



Turing:


View.Set ("graphics, offscreenonly")
var x : int := 50

loop
x := x+1
Time.Delay (10)
Draw.Fill (x, 50, 0, 0)
Draw.FillOval (x, 50, 50, 50, 16)
View.UpdateArea (0, 0, maxx, maxy)
end loop


Please specify what version of Turing you are using
Version 4.1
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Nov 21, 2012 7:50 pm   Post subject: Re: View.Update?

What does Draw.Fill do?
bvbjules13




PostPosted: Wed Nov 21, 2012 7:55 pm   Post subject: Re: View.Update?

it allows the circle to dissapear, i cant use cls b/c in my other programs there are other parts of the screen i need on
Insectoid




PostPosted: Wed Nov 21, 2012 8:11 pm   Post subject: RE:View.Update?

So you should be re-drawing only those areas using View.UpdateArea(). You're already doing that, except you're using it to update the whole screen instead of just one small spot. Alternatively (and preferably), just re-draw everything instead of just the circle.
Dreadnought




PostPosted: Wed Nov 21, 2012 8:11 pm   Post subject: Re: View.Update?

http://compsci.ca/holtsoft/doc/draw_fill.html wrote:

The Draw.Fill procedure is used to color in a figure that is on the screen.

Suppose we pass an (x, y) point to Draw.Fill that is NOT on the screen. What should happen then?
bvbjules13




PostPosted: Wed Nov 21, 2012 8:15 pm   Post subject: Re: RE:View.Update?

Insectoid @ Wed Nov 21, 2012 8:11 pm wrote:
So you should be re-drawing only those areas using View.UpdateArea(). You're already doing that, except you're using it to update the whole screen instead of just one small spot. Alternatively (and preferably), just re-draw everything instead of just the circle.


still doesnt seem to be working for me Sad
bvbjules13




PostPosted: Wed Nov 21, 2012 8:16 pm   Post subject: Re: View.Update?

Dreadnought @ Wed Nov 21, 2012 8:11 pm wrote:
http://compsci.ca/holtsoft/doc/draw_fill.html wrote:

The Draw.Fill procedure is used to color in a figure that is on the screen.

Suppose we pass an (x, y) point to Draw.Fill that is NOT on the screen. What should happen then?


will not draw anything...oh i see....that actually makes sense now to why it didnt work....
bvbjules13




PostPosted: Wed Nov 21, 2012 8:20 pm   Post subject: Re: View.Update?

Dreadnought thank you for your help Smile
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Nov 21, 2012 8:25 pm   Post subject: Re: View.Update?

No problem. Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: