-
Moving objects
Hi everyone,
I've been learning C# for a couple of months now, and I've ran into a problem.
I've drawn a Circle (FillEllipse) with the Paint-event. Now, I'd like the circle to move around in a specific area.
Is there an easy way I can make the circle move around (randomly), and bounce off panel "walls"?
Greetings,
Tom
-
Re: Moving objects
I haven't really worked with it, but WPF together with Expression Blend, could make your life a little easier.
Expression Blend is a Microsoft program for designers, et enables you to animate and completely customize the WPF controls. You should check it out.
-
Re: Moving objects
Thanks for sharing :)
Unfortunately, I'm bound to use only C#, without any add-ons / plug-ins..
So I really need something that I can get directly from C# / .NET..
Sorry to be such a pain :(
-
Re: Moving objects
WPF is .NET, i think it was added in .NET 3.5.
It's just an alternative to the normal forms. You can edit the design of the forms with XML, much like you would edit a web page with HTML.
If you are using visual studio there is a project template for WPF, and Expression Blend integrates quite well with visual studio. (right click a desig-file as choose edit in expression blend)
Take a look at this article: http://www.codeproject.com/KB/WPF/WPFAnimation.aspx
It explains how to do animations in WPF
-
Re: Moving objects
Found it!
Thanks a lot ;)
-
Re: Moving objects
Please specify what version of .NET you are using in future, as explained here :
http://www.codeguru.com/forum/showthread.php?t=401115
:)
-
Re: Moving objects
Create a timer.
At each timer event:
- change the coordinates of your circle,
- invalidate the control you are drawing on.