how can i make the cursor look different

BlitzMax Forums/BlitzMax Beginners Area/how can i make the cursor look different

drnmr(Posted 2005) [#1]
???


Perturbatio(Posted 2005) [#2]
Draw a new cursor in your paint program, save it wherever your source is, use hidemouse to hide the current pointer and then user drawimage at MouseX(), MouseY() in combination with your image and voila! a new mouse cursor.


drnmr(Posted 2005) [#3]
that just keeps copying the image over and over again to make a line of the image


Perturbatio(Posted 2005) [#4]
yeah, there's a little more to it.

try:
Graphics 800,600,32,0

Global myCursor:Timage = LoadImage("mycursorimage.png")

hidemouse()

while not KeyDown(KEY_ESCAPE)
cls 'clear the current drawing buffer
  DrawImage(myCursor, MouseX(), MouseY()) 'draw the image
flip 'show the result on screen
flushmem
wend
end



drnmr(Posted 2005) [#5]
i am making a program where you can draw, but when i try to draw it only changes the color of the cursor


Perturbatio(Posted 2005) [#6]
you might want to post some code at this point, it will make it much easier to help you.

use the forum codes to insert the code in a codebox.


Perturbatio(Posted 2005) [#7]
Here's a quick and simple drawing example:
Graphics 640,480,0,0

Global mx:Float = -1
Global my:Float = -1
Global oldmx:Float
Global oldmy:Float

While Not KeyDown(KEY_ESCAPE)

	
	If MouseDown(1) Then
		If Mx And My > -1 Then
			oldMx = mx
			OldMy = my
		Else
			oldMx = MouseX()
			oldMy = MouseY()
		EndIf
		mx = MouseX()
		my = MouseY()
		For f:Int = 0 To 1 'draw it twice since we don't want to have flickering in fullscreen when we flip
			SetColor(255,0,0)
			DrawLine(oldMX, oldMY, mx, my)
			Flip
		Next
	Else
		mx = -1
		my = -1		
	EndIf
	
	
	FlushMem
Wend
End


just before you draw your cursor image (not shown in above code), use SetColor(255,255,255)


drnmr(Posted 2005) [#8]
???
this is the section of my code where i tried to change the appearance of my cursor



la.