Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Timer Tick

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-12-2006   #1 (permalink)
ben174@gmail.com
Guest


 

Timer Tick

I'm working on a simple bouncy ball app... all I want is a little
Ellipse to bounce around the window hitting each edge and bouncing the
other way. In Windows Forms I would have used a timer, set to 50ms and
on each frame i'd set the location of the Ellipse to a new spot. I
understand now that there's timelines for this sort of thing, but this
just seems to be for a animation with no logic. All I want to do is set
the ball to a new location and animate it bouncing around. Any
recommendations on how to do this?

- Ben Friedland


My System SpecsSystem Spec
Old 10-12-2006   #2 (permalink)
szelee
Guest


 

Re: Timer Tick

You can check this one out.Seems to fit what you are looking for.

http://thewpfblog.com/?p=24

But you might need to open it with EID instead of VS2005. I have
modified it slightly myself. Let me know if you have any problem.




On Oct 13, 2:25 am, "ben...@gmail.com" <ben...@gmail.com> wrote:
> I'm working on a simple bouncy ball app... all I want is a little
> Ellipse to bounce around the window hitting each edge and bouncing the
> other way. In Windows Forms I would have used a timer, set to 50ms and
> on each frame i'd set the location of the Ellipse to a new spot. I
> understand now that there's timelines for this sort of thing, but this
> just seems to be for a animation with no logic. All I want to do is set
> the ball to a new location and animate it bouncing around. Any
> recommendations on how to do this?
>
> - Ben Friedland


My System SpecsSystem Spec
Old 10-13-2006   #3 (permalink)
TheRHogue
Guest


 

RE: Timer Tick

You can still use a timer if you want.

If you want to render per frame, like in DX, you use the
CompositionTargert.Render event to get called per frame. This feature should
be used when you need to apply physics or collision detection on objects, and
your animations are very quick.

You could use the animation engine to move your object around, but doing
during a mouse move seems to quick for me...and I would use frame based
animation.

If you are new to WPF, I would recommend getting a book on it. Trying to
learn via blogs may not be helpful because a lot of the community is past the
learning phase, and you will get much more complicated samples which won't
make any sense without learning the basics first.

Petzold book can be bought, and Adam Nathan and Chris Anderson's book will
be released shortly. I think all 3 of these book take a different approach to
teaching the material. It's all good stuff..including the SDK which has a lot
of nice samples and Overview reading - including a nice sample on frame based
animation



"ben174@gmail.com" wrote:

> I'm working on a simple bouncy ball app... all I want is a little
> Ellipse to bounce around the window hitting each edge and bouncing the
> other way. In Windows Forms I would have used a timer, set to 50ms and
> on each frame i'd set the location of the Ellipse to a new spot. I
> understand now that there's timelines for this sort of thing, but this
> just seems to be for a animation with no logic. All I want to do is set
> the ball to a new location and animate it bouncing around. Any
> recommendations on how to do this?
>
> - Ben Friedland
>
>

My System SpecsSystem Spec
Old 10-13-2006   #4 (permalink)
ben174@gmail.com
Guest


 

Re: Timer Tick

Thanks for the reply szelee and TheRHogue. This will surely get me
started.

- Ben Friedland

My System SpecsSystem Spec
Old 10-13-2006   #5 (permalink)
ben174@gmail.com
Guest


 

Re: Timer Tick

My only worry about buying a book right now is it seems that WPF is
changing dramatically with each beta (CTP, etc.). But... I suppose
you're right... learning off examples is a lot more difficult.

Thanks,
Ben Friedland


TheRHogue wrote:
> You can still use a timer if you want.
>
> If you want to render per frame, like in DX, you use the
> CompositionTargert.Render event to get called per frame. This feature should
> be used when you need to apply physics or collision detection on objects, and
> your animations are very quick.
>
> You could use the animation engine to move your object around, but doing
> during a mouse move seems to quick for me...and I would use frame based
> animation.
>
> If you are new to WPF, I would recommend getting a book on it. Trying to
> learn via blogs may not be helpful because a lot of the community is past the
> learning phase, and you will get much more complicated samples which won't
> make any sense without learning the basics first.
>
> Petzold book can be bought, and Adam Nathan and Chris Anderson's book will
> be released shortly. I think all 3 of these book take a different approach to
> teaching the material. It's all good stuff..including the SDK which has a lot
> of nice samples and Overview reading - including a nice sample on frame based
> animation
>
>
>
> "ben174@gmail.com" wrote:
>
> > I'm working on a simple bouncy ball app... all I want is a little
> > Ellipse to bounce around the window hitting each edge and bouncing the
> > other way. In Windows Forms I would have used a timer, set to 50ms and
> > on each frame i'd set the location of the Ellipse to a new spot. I
> > understand now that there's timelines for this sort of thing, but this
> > just seems to be for a animation with no logic. All I want to do is set
> > the ball to a new location and animate it bouncing around. Any
> > recommendations on how to do this?
> >
> > - Ben Friedland
> >
> >


My System SpecsSystem Spec
Old 10-13-2006   #6 (permalink)
Douglas Stockwell
Guest


 

Re: Timer Tick

Those changes have slowed down almost to a complete stop now. As far as I
know, WPF is being locked down for RTM with Vista.

- Doug

<ben174@gmail.com> wrote in message
news:1160761143.113649.192410@m73g2000cwd.googlegroups.com...
> My only worry about buying a book right now is it seems that WPF is
> changing dramatically with each beta (CTP, etc.). But... I suppose
> you're right... learning off examples is a lot more difficult.
>
> Thanks,
> Ben Friedland
>
>
> TheRHogue wrote:
>> You can still use a timer if you want.
>>
>> If you want to render per frame, like in DX, you use the
>> CompositionTargert.Render event to get called per frame. This feature
>> should
>> be used when you need to apply physics or collision detection on objects,
>> and
>> your animations are very quick.
>>
>> You could use the animation engine to move your object around, but doing
>> during a mouse move seems to quick for me...and I would use frame based
>> animation.
>>
>> If you are new to WPF, I would recommend getting a book on it. Trying to
>> learn via blogs may not be helpful because a lot of the community is past
>> the
>> learning phase, and you will get much more complicated samples which
>> won't
>> make any sense without learning the basics first.
>>
>> Petzold book can be bought, and Adam Nathan and Chris Anderson's book
>> will
>> be released shortly. I think all 3 of these book take a different
>> approach to
>> teaching the material. It's all good stuff..including the SDK which has a
>> lot
>> of nice samples and Overview reading - including a nice sample on frame
>> based
>> animation
>>
>>
>>
>> "ben174@gmail.com" wrote:
>>
>> > I'm working on a simple bouncy ball app... all I want is a little
>> > Ellipse to bounce around the window hitting each edge and bouncing the
>> > other way. In Windows Forms I would have used a timer, set to 50ms and
>> > on each frame i'd set the location of the Ellipse to a new spot. I
>> > understand now that there's timelines for this sort of thing, but this
>> > just seems to be for a animation with no logic. All I want to do is set
>> > the ball to a new location and animate it bouncing around. Any
>> > recommendations on how to do this?
>> >
>> > - Ben Friedland
>> >
>> >

>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
sysconfig/ boot/ advanced/ tick box on/off for amount of memory ? Gus Vista General 1 06-01-2008 08:31 PM
Work Offline Tick out_n_bout Vista General 1 09-12-2007 09:14 AM
Egg Timer Mario Rosario Vista General 11 02-04-2007 11:47 AM
RC2 Egg Timer Mario Rosario Vista General 4 10-10-2006 04:46 PM
Error message on back tick Andrew Watt [MVP] PowerShell 6 06-22-2006 07:45 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51