miker
29th January 2006, 07:28
Hi
I am currently trying to write a small card game in Qt 4.
I am using a QWidget with the paint method overidden for drawing.
I want to be able to drag and drop cards. I can use mouseDown and mouseMove and keep painting the card making sure I have the old background to paint back when the card moves. Or is there a better way? Problem: How do I paint from the mousemove event?
I also want to be able to animate the cards moving across the board. Im not sure how to do this as the animation would have to be some kind of loop and I dont know how to paint outside of being in the paint method. Would my loop just update some co-ordinates somewhere and call a repaint and the paint method take care of it?
If everything were to be done in the paint method its going to get pretty large. right?
Thanks.
Mike
I am currently trying to write a small card game in Qt 4.
I am using a QWidget with the paint method overidden for drawing.
I want to be able to drag and drop cards. I can use mouseDown and mouseMove and keep painting the card making sure I have the old background to paint back when the card moves. Or is there a better way? Problem: How do I paint from the mousemove event?
I also want to be able to animate the cards moving across the board. Im not sure how to do this as the animation would have to be some kind of loop and I dont know how to paint outside of being in the paint method. Would my loop just update some co-ordinates somewhere and call a repaint and the paint method take care of it?
If everything were to be done in the paint method its going to get pretty large. right?
Thanks.
Mike