Bouncing Back…


Trying to ease back into the community after a short hiatus, I ported the Boing demo that I blogged about back in June to the Avalon CTP buildYou can get the updated source here.  Just load the solution in to the VS.NET Whidbey Beta and press F5.  If you are using Visual C# Express, see RRelyea’s notes (via ChrisAn).

You will probably notice that the demo hasn’t changed much since WinHEC:

But there are some differences (mostly in the code):

  • It’s running on Windows XP (note the Luna theme with blue color scheme – blue is very important!)
  • The source comes in the form of a VS.NET solution.
  • Window1.xaml’s code behind is almost empty:
    • The ball is now animated entirely using the platform animation features instead of a Timer.
    • The ball’s geometry is shared via <Application.Resources> in MyApp.xaml instead of being parsed from a string at runtime.

If you want to have some fun with the animation, try moving the animated RotateTransform3D to the end of the Transform3DCollection to get an effect that looks less like physics and more like poltergeist activity:

(If you’re not sure what is going on, this might help.)


Comments (19)

  1. Great stuff! Thanks!

    I think there is a problem on a 120dpi screen though :-(

    The same applies to most of the CTP sample appls too.

    This is not a complaint. I know it’s early days!

    .savas.

  2. danlehen says:

    Hi Savas – By "problem on 120dpi", do you mean it doesn’t scale like you would expect, or something else?

    If you could describe a bit more what you are seeing and how you repro the problem I’ll make sure we have an issue logged to track it.

    …oh, and by all means feel free do not feel shy about "complaining"! Any customer installing our pre-Beta bits and helping us to build a better product by sending issues and feedback our way is deeply appreciated!

    Thanks,

    – Daniel

  3. By "problem on 120dpi" i mean that some of the calculations don’t seem to happen properly. I’ve experienced this with other sample applications too and ChrisA’s XamlPad.

    With Boing, the ball never reaches the edges of the window (it bounces earlier) and never reaches the "floor" (it bounces earlier too).

    With ChrisA’s application there are issues with the menus (some of the menu items are not visible). Also, there seems to be a problem with the mouse. With some menu items you have to move the mouse pointer beyond the menu item itself in order to get it highlighted. ChrisA’s comments don’t seem to work so I couldn’t give him feedback.

    I can sent you screenshots of other sample applications if you want.

    regards,

    .savas.

  4. danlehen says:

    Ah, I think I know exactly what you are hitting with the mouse not lining up with the menu items. Thanks for letting us know!

    I don’t have Boing in front me on my work box, but IIRC, it didn’t go all the way to the window edges in 96dpi either. Are you noticing a difference?

  5. Aha! Ok… that’d explain the window edges. However, on my box i never see the ball reach as far down as the screenshot you have above (the mirrored ball being so close to the actual ball). It bounces way before. (it may be just my eyes though :-)

    Also, about the menus in ChrisA’s XamlPad. It’s not just the mouse but also the menu items themselves. it seems to me that although the text scales, the size of the menu doesn’t. As a result, the last item under "Snippets" is not shown although it’s there. I can see few pixels from it and i can go to it using the arrow keys but is not shown on the screen.

    I hope this helps.

    .savas.

  6. danlehen says:

    Yes, it does help! Would you mind sending me your email address privately via the "Contact" link on http://blogs.msdn.com/danlehen so that I can ping you back if I need more info?

  7. danlehen says:

    Just wanted to post a quick thank you to Savas and the other person who wrote in to help. We can repro the behavior you are describing on our side and are tracking the issue.

  8. Bring It On says:

    DirectX 9 capable video card is recommended for Avalon development. How does virtual machine with no acceleration stack up?

  9. robk says:

    thanks for porting this to the CTP, some interesting stuff here!

    I do have an odd problem where mouse movement halts the animaition? is this an issue with the app message processing or just my setup?

  10. Alfred says:

    Even working smoothly via remote desktop to a virtual machine :-) always was a nice demo voor the Amiga…

    Takes about 60KB/s network traffic but it works.