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 / Tic-tac-toe button

Author
Message
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 18th Dec 2003 01:49
I want to create a button to start the game of tic-tac-toe I'm creating. Any "create button" type commands?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 18th Dec 2003 07:00
Why not take a look in the codebase?

I put a fully working tic tac toe game in there a few months back. You're very welcome to look at that. It doesn't have any buttons or, indeed, any graphics (because it was just a demonstration) but it is a fully working tic tac toe game.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Dec 2003 08:32
you need to make a sprite to represent your button, then use Mousex() and mousey(), along with Mouseclick() functions to determine if the user's mouse was within the button constraints when it was clicked.

-RUST-

VB.NET makes me all goose-pimply!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 18th Dec 2003 15:12
Trust Bob to answer the question and be helpful rather than procrastinate mindlessly like me.

Like I am doing now in fact.

And just then.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Dec 2003 16:41
heh heh "Bob" ? LOL
My real name is James. My nickname comes from "The Jerky Boys". Their 3rd cd introduced a charcter named "Big 'Ol Fat Ass Bob, The Cattle Rustler" which is funny as hell so I use that as my online persona. I know my signature contains "Bob" and you are not the first to refer to me as "Bob", but I would prefer "CattleRustler" or "Cattle" or "Rust", I think Mattaman refers to me as "CastleRunner" - LOL

Thanks,
"Not Bob"


-RUST-

VB.NET makes me all goose-pimply!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Dec 2003 21:10
or you can make a very tiny one pixel sprite and display it at an offset that places it right at the tip of the cursor and then check for a collision with that sprite and the one that makes up the button whenever the mouse is clicked eg(psuedocode)



hope thats some help

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD`s, DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800 128mb.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Dec 2003 22:22
do
if mouseclick()=0 then flag=0
if mouseclick()=1 and flag=0 and mouseWithIn(1,1,100,50)=1
flag=1
button has been clicked
endif

loop



function mouseWithIn(x1, y1, x2, y2)
if mousex()>x1 and mousex()<x2 and mousey()>y1 and mousey()<y2 then exitfunction 1
endfunction 0
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 19th Dec 2003 17:12
Er... too late. I've now got you stuck in my head as "Fat Ass Bob". :-(

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Dec 2003 18:08
lol - "Fat Ass Bob" is fine, I don't fancy just "Bob" tho.


-RUST-

VB.NET makes me all goose-pimply!

Login to post a reply

Server time is: 2024-09-21 14:51:40
Your offset time is: 2024-09-21 14:51:40