Please help support this free site and future BRL projects!

Login or Signup

Change mouse cursor.

BlitzPlus Forums/BlitzPlus Programming/Change mouse cursor.

Cold Harbour(Posted 1+ years ago) #1
Hi, I've been looking for a way of changing the mouse cursor (in Windows mode not full screen) to one of the different shapes but can't see what command I use.

Can anyone help me? Thank you.

(I want to change the mouse cursor to an up down arrow shape when it's at a certain point on the screen that coincides with with a dragable canvas anchor point.

rdodson41(Posted 1+ years ago) #2
You probably only have to work with HidePointer, ShowPointer, and DrawImage. Just draw your image at MouseX and MouseY, and use hidpointer to hide the normal pointer.

Global w=640,h=480					;Define Variables (I always make them global no matter what)
Global image=LoadImage("image.bmp")	;This would be your image

Graphics w,h,16,2	;Start GFX Mode
HidePointer			;HidePointer hides the normal cursor

Repeat							;Make a loop
	Cls							;Clear Screen
	Rect MouseX(),MouseY(),5,5	;Normally you would draw your image here, but for now I am drawing a Rectangle.
	Flip						;Flip onto Frontbuffer
Until KeyHit(1)					;Check If user has hit escape

Hope it helps!

[EDIT]: Sorry about my unorganized code. I'm still getting used to posting code.

Cold Harbour(Posted 1+ years ago) #3
Cheers Rich05

That should work fine for me.

And thanks for taking the trouble to write that code :-)

KeithJ(Posted 1+ years ago) #4
also see:
this code shows how to use userlibs to change the pointer to any of windows standard ones.

Cold Harbour(Posted 1+ years ago) #5
Oh yes, I missed that.

One day I'm going to have to learn how to use userlibs.

Cheers Keith.