0
\$\begingroup\$

I want to make a button that can spawn an object that I've already created. Though I have no clue how to actually do this / where to start. Has anyone ever done something similar?

\$\endgroup\$
2
  • \$\begingroup\$ What language? What libraries? \$\endgroup\$ – HolyBlackCat Jun 4 '16 at 18:43
  • \$\begingroup\$ C++, OpenGL using GLUT and GLM is what i'm using at the moment. \$\endgroup\$ – Mettalknight Jun 4 '16 at 19:01
3
\$\begingroup\$

In short - you track input events (whatever you have), and check if mouse/touch/whatever click coordinates is crossing sensing area that designate your button on screen. Then you call associated function that process this event.
Detailed answer will require explaining lots of very basic stuff (you didn't even name your windowing lib/framework/api), and you should learn that yourself.

\$\endgroup\$

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