Image Trail Problem (image attatched)

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Ti22
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Apr 01, 2005 3:00 pm

Image Trail Problem (image attatched)

Post by Ti22 » Fri Apr 08, 2005 12:48 am

Hey guys,

I got the collision detection working, and the keyboard stuff working

now the problem i have is its making a trail when i move the sprite.

Image

mjs
Experienced Solver
Experienced Solver
Posts: 93
Joined: Wed Feb 09, 2005 3:53 am
Contact:

Post by mjs » Fri Apr 08, 2005 3:51 am

Maybe you should restore the background?

Regards,
Mark

koderpat
Experienced Solver
Experienced Solver
Posts: 62
Joined: Tue Apr 05, 2005 5:04 am
Contact:

Post by koderpat » Fri Apr 08, 2005 6:53 am

Are you using a sizer?

I think you need something to handle EVT_PAINT, and check something about clipping to redraw the background over the sprites previous spot.

Ti22
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Apr 01, 2005 3:00 pm

Post by Ti22 » Sat Apr 09, 2005 7:56 pm

how do I do this?

I am uploading the code now so can you guys please take a look at what I can do?

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Sun Apr 10, 2005 7:28 am

Try to look at RedrawRect. You should issue the RedrawRect on the window that has the background image. wxDC::RedrawRect() and pass the x, y of the sprite on it's old position, and the height and the width of the sprite. After that draw the sprite on the new position.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Post Reply