Windows Vista Forums

Timer Tick

  1. #1


    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

  2. #2


    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

  3. #3


    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

  4. #4


    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

  5. #5


    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

  6. #6


    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

Timer Tick

Similar Threads
Thread Forum
Tick tick tick
I have vista 64 and when I turn in my computer it makes a ticking noise. Windows dosent start so it goes into startup repair and that dosent do...
Crashes and Debugging
How to Generate an Accurate Timer Tick
I asked a question related to this a little while ago, and thought that I'd got my answer, but it has come back to bite me again. I currently use...
.NET General
tick mark or what ?
Case 1 - it works the way i want it - case 2 the whole arry is written. why? 'where is my thinking going wrong'? ist's just the blank (Write-Host...
PowerShell
Lottery tick
Please tellwhat are the numbers of todays lottery tick are.
Vista mail
Work Offline Tick
I'm new to Windows Vista and not extremely good with computers but I seem to keep having a problem with the Work Offline option being ticked in both...
Vista General
Re: Dissapearing tick box
"Bob Phillips" <BobNGs@xxxxxx> wrote in message news:%237Ibh3xEJHA.4304@xxxxxx The OP crossposted to Vista General.....
Vista General
Error message on back tick
I mistyped a `n (backtick-n) outside paired quotes and got an error message. The error message appears to be treating the backtick as an...
PowerShell