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.

DarkBASIC Professional Discussion / Any-Diaginal Shape with Clicking?

Author
Message
Jachan
16
Years of Service
User Offline
Joined: 1st Mar 2010
Location:
Posted: 13th Nov 2010 17:30
I tried to thought of many ways to program on this single object but it would take a lot of writing and didn't work because it's too many numbers / strings... I was trying to make familiar between those two pictures.
<--->

I can do the four vertexes to form the box, so that player can click that button inside the box but for this case, I need to know how to create that (left picture) without have each box-click being merged together... hope you know what I am talking about.

P.S.: Please don't ignore this because THIS is the VERY hardest part for me to think / program.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Nov 2010 20:08
If I've understood you correctly you could make each hexagon a single object and simply use the pick object command to find out which object has been clicked.

You could make the hexagon objects yourself out of six triangle objects meeting at the centre, or a plain and two triangles, or, better but harder to do, make your own hexagonal mesh consisting of 4 or 6 triangles.
Jachan
16
Years of Service
User Offline
Joined: 1st Mar 2010
Location:
Posted: 13th Nov 2010 21:19
That sounds like that's the one... I will test it and let you know the results.
Jachan
16
Years of Service
User Offline
Joined: 1st Mar 2010
Location:
Posted: 13th Nov 2010 21:55
Uh... how can I do that? I read the statement of Pick-Object but didn't get at all... will it work if I write like this?

If it is not correct, then would you mind to show me what should I do / program with that Pick-Object? like step-by-step for the first one to work, so that i will do the rests... how about it? I just asked this because I never heard anything about Pick-Object in few years since I started program it. It was not found in my "Darkbasic Professional" textbook, unless I missed it out.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Nov 2010 04:31 Edited at: 15th Nov 2010 04:33
I have attached a .rar file that has everything in it. Just to show you what the source code is:



If you don't have WinRar yet, you can download a free trial version here:

http://download.cnet.com/WinRAR-32-bit/3000-2250_4-10007677.html

You can click on the buttons on the phone and it will register the numbers. Press the upper left button above the numbers and it will 'dial' the number and after two seconds the program will end. The upper right button deletes any numbers you have entered. The * and # buttons register also.

How I did this:
1. Made a plain in Milkshape and used the cell phone texture you provided.
2. Added joints to the model at the locations where the buttons were located (created them in reverse order).
3. Created a hexagon shape also in Milkshape.
4. Loaded both objects into DBP, and cloned the hexagon shape for each button.
5. Placed the hexagon shapes at the joint locations.
6. Used transparency to hide the buttons from view.
7. Coded the buttons' responses. Voila.

Jachan
16
Years of Service
User Offline
Joined: 1st Mar 2010
Location:
Posted: 17th Nov 2010 22:50
Thanks, LBFN... but one problem, I am not using THAT image... it's just a showing image to everybody for my idea because i am just designing my own cell-phone shape that would be more like front-view, not as in 3/4-view. But I will see what I can do that when I finish design the cell-phone and program it, okay? Once again, thank you, LBFN.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Nov 2010 00:57
You're welcome. There are other ways to go about it than what I have done, but that was easiest for me and didn't take much time. I would be glad to do the same for the cell phone design you come up with if you need help with it.

LB

Login to post a reply

Server time is: 2026-07-21 18:57:53
Your offset time is: 2026-07-21 18:57:53