changing shape of mousepointer in VB DX7
I am working on a tile RPG and I am currently devloping the code for the character''s inventory. What I have is a backpack showing the items. What I am going for is to have the mousepointer change it''s shape to that of the item the user clicks on. So it looks like the user picks up the item with the mouse. The problem is that all of my item pics are BMP and the MouseIcon property in vb expects an ICO or CUR only. Any idea on what I can do here? Thanks.
There are multiple ways of doing this. One way is to use the iconedit sample program with VB3, use the picture editor with vb4 or use the Icon Editor in Visual Studio to convert to icons. I prefer Visual Stuido because it accepts 256 colors. The hard way is to convert the bitmap in runtime. I never did that, but I assume that works. The best way is to hide the mousecursor with ShowCursor.
Private Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long
After that you should update the cursors position in a variable with Form_MouseMove(...). Then use some sort of Windows API such as GDI or DirectX to draw the bitmap in the render loop or you can just draw it in the Form_MouseMove.
Edited by - nes8bit on 3/14/00 7:45:08 PM
Private Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long
After that you should update the cursors position in a variable with Form_MouseMove(...). Then use some sort of Windows API such as GDI or DirectX to draw the bitmap in the render loop or you can just draw it in the Form_MouseMove.
Edited by - nes8bit on 3/14/00 7:45:08 PM
The easiest will be to work out the mouse position yourself and Blt the pointer to the screen. Ultyimately this give you more control and help the nasty GDI/DirectX interference effects that one can expect.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement