Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / mouse cursor clicking on a sprite

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Apr 2005 03:27
Hi All

Same old question? please, how do I get the mouse cusror to click on a sprite, so that the sprite I click starts another bit of code. code works ok if I use the upkey command.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 6th Apr 2005 04:42
I would do it by hiding the mouse and replacing it with a sprite then do something like

if mouseclick()=1
if spritehit(mousenum,buttonum)=1 then do something
endif

The happenings of tommorow are behind us now
Saido
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: The Netherlands
Posted: 6th Apr 2005 04:43
Use something like this:

Ofcourse you must change the variables to those you wish to use.


Ik zou groug Nederlandse mensen in mijn msn willen hebben die mij kunnen helpen met het leren van DBpro.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Apr 2005 05:05
Thats what I thought would be the answer.

Ok so how would I get the mouse image that I or other user are using in windows, in other words use the default mouse image form windows.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 6th Apr 2005 05:32 Edited at: 6th Apr 2005 05:35
On my computer if you go to
C:WINDOWSCursors
it shows you all the cursors.
If you then take a screenshot of your computer (shift+prnt scrn)
you can open it in paint and edit it as you wish

The happenings of tommorow are behind us now
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Apr 2005 05:38
cheers wonder where they were kept.

however I would like to use the one that is being use at that time by the user.

Anyone got any ideas on how I could achive this?

In Space No One can Hear You Scream! (When your comm Line is cut?)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Apr 2005 07:34
If you work in Full Screen Windowed mode, the Windows cursor will be displayed. Just don't HIDE MOUSE

BatVink
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Apr 2005 02:17
I know that, I wanted to copy the one the use may be using at anytime and make that the one to use as a sprite.

only want to this because I can't draw any good cusros myself.

In Space No One can Hear You Scream! (When your comm Line is cut?)
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 7th Apr 2005 21:08
IF you wanted to use your own cursor:

(the '1' could be any number)

load image "cursor.bmp",1

do

`..your normal stuff

paste image 1,mousex(),mousey()
sync

loop

Mr Blanky - This Time, It's Personal
Dsarchy
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: UK- Kent
Posted: 8th Apr 2005 04:04
or you can use a simple convertor off the internet to change the image into a cursor file and then load that up, i know there are a few freeware ones around,
im not 100% sure but i think mousex() and mousey() slows down frame rate (which could be an important factor later on in you app/program)
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 8th Apr 2005 05:43
You also don't even have to hide the mouse and replace it with a sprite. You would still use a sprite, but hide the sprite instead of the mouse pointer.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 8th Apr 2005 07:39
or i guess you could make a really small sprite and position it at the end of the cursor.

The happenings of tommorow are behind us now

Login to post a reply

Server time is: 2024-09-23 17:21:55
Your offset time is: 2024-09-23 17:21:55