Cabbage Logo
Back to Cabbage Site

Use other shapes than rectangle/square for "buttons"?

How might it be possible to build a UI with Cabbage that has various shapes for user interaction? E.g. tessellating hexagons or triangles that trigger events when pressed.

You could use an image and a combination of chnget:k("MOUSE_X"), and chnget:k("MOUSE_Y") channels to test where a user click happens.

You’d just need to write to appropriate code to see if a click falls within a hexagon?

Actually, you don’t need to bother checking coordinates. Just make each image a button. Check out this example. Of course you can add some kind of animation to each image if you want to give some visual feedback to the user.

hexSynth.csd (910 Bytes)
hex4
hex3
hex1