hey guys, i've got htis problem i've been workin on for the whole of today without success
basically the bitmap is not colliding where it is, its colliding at its origin (the point where its created) and its really getting annoying.
Is there anything I can do to get the bitmap to actually be the actual size of the bitmap itself rather than just 1 pixel which is the size of the origin where the bitmap is being created.
I am using wxWidgets btw.
Create bounding box using the origin, with and height of the bitmap. Then use this for your collision tests.
how do i create the bounding box using the origin? just draw a rectangle?
the origin is just a point in space.
If you wont be rotating the box:
Or if you are then use a Direct3D quad.
I've draw a rectangle behind for the sprite
however it still uses the origin (one point) of the rectangle to test the collision detection.
You dont need to draw the rectangle.. you need to use it to test for collisions. Dont't test the sprite for collisions, test the rectangle.
Like Perspective said you dont draw the bounding rectangle, it is just there. just make the bounding rectangle the size of your sprite or a little less than your sprites size and calculate this size based on your sprite position parameters, so it will follow the sprite. dose this help any? and it sounds like your code is only for testing for a single point of collision so you will have to change that to.