• Advertisement

Archived

This topic is now archived and is closed to further replies.

changing shape of mousepointer in VB DX7

This topic is 6549 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement