0
$\begingroup$

I am trying to create an interactive map that when you click a room, you get send to a more detail of it. I am struggling to put multiple buttons on an image as well as have them line up with the image properly. Does anyone have any tips on how to do this efficiently?

$\endgroup$
2
  • 2
    $\begingroup$ This is, I’m afraid, entirely too vague and broad as posted. Perhaps you could give us an example of what you have done so far. $\endgroup$
    – MarcoB
    Jul 5, 2018 at 4:21
  • $\begingroup$ Welcome to Mathematica.SE. Could you be more specific in your question? Please share the code you are working on. Only good questions are likely to get great answers. Your question is currntly on-hold because in its current form is off-topic. To rever that please edit your question to improve it. Also consider taking the tour. $\endgroup$
    – rhermans
    Jul 7, 2018 at 9:37

1 Answer 1

6
$\begingroup$

Actually, any button is an image. Therefore, you can create graphics background and put the button on it using Epilog->Inset[..] . The insets could be easy arranged according to certain coordinates within the background graphics as below:

bcol = Orange;
Graphics[{Gray, EdgeForm[{Black, Thick}], 
  Rectangle[{0, 0}, {100, 40}]}, 
 Epilog -> {Inset[Button["test", Print["!!"]], {70, 10}], 
   Inset[Dynamic@Button["ToRed", bcol = Red, Background -> bcol], {20,35}]}]

enter image description here

Buttons are nicely working..

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.