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 / I ONLY HAVE ONE QUESTION

Author
Message
Cyberflame
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 27th Dec 2003 03:40 Edited at: 27th Dec 2003 03:50
how do I tell dark basic that I want to click on a sprite then I want db to do something.



im using db classic

VISIT MY GAME DEV SITE: http://www.neoeden.web1000.com/
VISIT MY APPAREL SITE : http://Cafeshops.com/gerritgear
D I G I T A L
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: Dubai, UAE
Posted: 27th Dec 2003 04:05
1. load ur sprite on the screen: sprite spritenum,X,Y,imagenum
2. see where ur sprite has been loaded on the screen (X,Y)
3. make you mouse check for these positions if the mouse pointer enters them: If mousex<x1 and mousex>x2 and mousey<y1 and mousey>y2
4. make another check for the mouseclick when the mouse pointer is still over that position: if mouseclick()=1 then print"hello"
5. the END.

zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 28th Dec 2003 21:45 Edited at: 28th Dec 2003 21:58
Assuming that you have not done SPRITE OFFSET, the XY of your sprite is the upper left corner. So, if your sprite is 32x32 pixels, you can do something like this: (see source button)
--
TAZ

[edit] Some typos made it into the comments, but the code should work for you. [/edit]
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 29th Dec 2003 01:23
if you are using dbc there is a tutorial that comes with it that shows exactly what you want

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com

Login to post a reply

Server time is: 2024-09-21 13:46:42
Your offset time is: 2024-09-21 13:46:42