Displaying your own mouse cursor
I''m using Visual C++ and DirectX7 and I was wondering what the best way to create my own cursor. I was thinking of making a CCursor class which would hold the coordinates and surface to get image from. Then once a frame check for any change in coordinates, update coordinates and then blit the surface at that position. Is this the best way to do this or is their another, better way?
~punx
a little easier way is to keep 2 variables, say MouseX and MouseY, and just update them with in your DirectInput loop.
like MouseX+=Mouse.lX; (You will need to add some sort of clipping, like if(MouseX>800)Mousex=800; (or whatever your screen coordcs are)
Then all you have to do is blit your mouse graphic using the MouseX and MouseY veriables.
Good luck!
like MouseX+=Mouse.lX; (You will need to add some sort of clipping, like if(MouseX>800)Mousex=800; (or whatever your screen coordcs are)
Then all you have to do is blit your mouse graphic using the MouseX and MouseY veriables.
Good luck!
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement