question:how to draw an image at the mouse coords?

Blitz3D Forums/Blitz3D Beginners Area/question:how to draw an image at the mouse coords?

Cp(Posted 2008) [#1]
Okay, I need help...I don't know how to draw an image at the mouse's coords...How do I do it?And one more thing...
this is for a game, I need to test if the mouse image and button collide, I think you do it like this:
If ImagesOverlap(mouseimage,mousex,mousey,button,320,30)
if mousehit(1)
;do something
endif
endif

but, of course, that doesnt work because the image doesnt move with the mouse!
I do the image drawing like this:
[code]
drawimage mouseimage,mousex,mousey


KillerX(Posted 2008) [#2]
If ImagesOverlap(mouseimage,mousex(),mousey(),button,320,30

you need the parenthesis or MouseX and MouseY will return 0.
Like this
Print MouseX()
Print MouseY()



Cp(Posted 2008) [#3]
thanks killerx, it works.
weird how it needs ()


Ross C(Posted 2008) [#4]
It's because it's a function and returns data, the data being the mouse co-ord on the x or y axis.


Beaker(Posted 2008) [#5]
To get any command/function to return a value in any version of Blitz you always need brackets ().


Cp(Posted 2008) [#6]
OK.Thanks.