How would I make a radial menu in live code?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
wolfkillshepard
Posts: 44
Joined: Tue Jul 12, 2011 7:43 pm

How would I make a radial menu in live code?

Post by wolfkillshepard » Tue Aug 02, 2011 6:39 pm

Hey my name is Christian and I am currently working on a project on which we have a dashboard start screen and on this screen we wanted to have a radial menu that would take you to different parts of the app.

-We want pieces of the radial menu to be accessible as you hold down you finger and drag it across the "pieces of pie" if you will.

-When you lift you finger while it has a piece selected you will open that option.

-When you lift your finger while it is in the center of the radial or anywhere off of a piece nothing will happen, the user will not navigate.

If anyone has any idea of how to get this to work please reply

-Christian Spring

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: How would I make a radial menu in live code?

Post by BvG » Tue Aug 02, 2011 8:28 pm

mouseDown
mouseUp
mouseRelease
mouseWithin
mouseMove
the target
the mouseControl
the mouse
click
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

wolfkillshepard
Posts: 44
Joined: Tue Jul 12, 2011 7:43 pm

Re: How would I make a radial menu in live code?

Post by wolfkillshepard » Tue Aug 02, 2011 9:37 pm

That's for those commands but I am having trouble implementing them, could you give me a sample script?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10339
Joined: Wed May 06, 2009 2:28 pm

Re: How would I make a radial menu in live code?

Post by dunbarx » Tue Aug 02, 2011 11:27 pm

Do you mean a sort of "pie" chart, where individual slices of the pie might be separate objects? And when you say "hold your finger", do you mean "move the mouse", whether or not the mouse is down?

If yes to any of these, then perhaps you might experiment with polygons and circles. These can be drawn to make your pie chart, and are really used here like buttons, in that they can respond to some of the standard messages that Bjoernke suggested.

Play with this idea. Write back for more details. If you can do what you want with a string of buttons, you should be able to construct your gadget.

Craig Newman

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: How would I make a radial menu in live code?

Post by Dixie » Tue Aug 02, 2011 11:45 pm

Hi...

Very quickly a little stack.. have a look in the application browser to see how the objects are positioned... the scripts are in the objects p1 through p4

hope it helps

Dixie
Attachments
simplePie.livecode.zip
(1.42 KiB) Downloaded 310 times

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: How would I make a radial menu in live code?

Post by Kaubs » Wed Aug 03, 2011 12:17 am

I have linked a video which states the kind of menu he is talking about. Thanks for the example dixie but the issue with that in iOS is that it only recognizes clicks over one quadrant. The IOS is hard because we would really like to see a fluid motion and then select the object upon touchrelease.

this is the radial style he is trying for.
http://www.youtube.com/watch?v=z0vGqZ66n54

I have no idea as to how making that work would look.

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: How would I make a radial menu in live code?

Post by Regulae » Wed Aug 03, 2011 4:47 am

Hi there,

You could try the attached stack. I haven't tried to make it look like the example- the key at the moment is finding out whether the script will give you the sort of performance you want in iOS. Refinements can be made later. The five fields are in a group- the script is in the group, so "untick" select grouped controls under LiveCodes "Edit" menu to select the group.

Regards,

Michael
Attachments
radial test.zip
(1.01 KiB) Downloaded 336 times

wolfkillshepard
Posts: 44
Joined: Tue Jul 12, 2011 7:43 pm

Re: How would I make a radial menu in live code?

Post by wolfkillshepard » Thu Aug 04, 2011 6:20 pm

Thanks a lot I manged to get what I wanted with it.

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: How would I make a radial menu in live code?

Post by Regulae » Sat Aug 06, 2011 7:59 am

Hi there,

It's good to hear you've got something working. The particular challenge is having the menu segments highlight as the mouse/finger enters them, during the "mouse is down" state. mouseEnter/Leave messages aren't sent, but mouseMoves, with the parameters newMouseH, newMouseV, are. The previous stack detected movement into the menu segments by using those parameters. More complex menus can be hard to define this way, the "<" and ">" conditions become elaborate. The attached stack uses a different method which detects regions without having to define them in the mouseMove handler, in case anyone's interested.

Regards,

Michael
Attachments
radialmenu.zip
(4.82 KiB) Downloaded 335 times

Post Reply