# Button without GUI

**URL:** <https://forum.babylonjs.com/t/button-without-gui/10123>\
**Category:** Questions\
**Created:** [April 18, 2020, 9:31pm UTC](https://forum.babylonjs.com/t/button-without-gui/10123 "2020-04-18T21:31:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilyes\_ELAYEB](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ilyes_elayeb/32/7662_2.png) [@Ilyes\_ELAYEB](https://forum.babylonjs.com/u/Ilyes_ELAYEB)\
**Post date:** [April 18, 2020, 9:31pm UTC](https://forum.babylonjs.com/t/button-without-gui/10123/1 "2020-04-18T21:31:06Z")

</div>

hello everyone , can i display button on babylon canvas without GUI ?  
ps : i have a problem with babylon.GUI version and my angular project version

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [April 19, 2020, 12:30am UTC](https://forum.babylonjs.com/t/button-without-gui/10123/2 "2020-04-19T00:30:15Z")

</div>

Hi again. Use a plane as button, with dynamicTexture as button label-text, and use actionManager for pointer trigger. That’ll work.

---

<div class="post-metadata">

**Author:** ![Ilyes\_ELAYEB](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ilyes_elayeb/32/7662_2.png) [@Ilyes\_ELAYEB](https://forum.babylonjs.com/u/Ilyes_ELAYEB)\
**Post date:** [April 19, 2020, 1:13am UTC](https://forum.babylonjs.com/t/button-without-gui/10123/3 "2020-04-19T01:13:46Z")

</div>

thanks WIngnut , hope your good and safe

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [April 19, 2020, 12:30pm UTC](https://forum.babylonjs.com/t/button-without-gui/10123/4 "2020-04-19T12:30:50Z")

</div>

Thx, I hope the same for you, my friend.

I thought I would make a little example button… with help from other playground makers…

[https://www.babylonjs-playground.com/#1282WV#36](https://www.babylonjs-playground.com/#1282WV#36)

DT text is VERY difficult to position, and difficult to change later… but that one works ok, sort-of. When clicked… watch border color and console report.

It is currently using _onPickTrigger_ but you could use _onPickDownTrigger_ and/or _onPickUpTrigger_ and [other triggers](https://doc.babylonjs.com/how_to/how_to_use_actions#triggers), too.

IF you register onPointerOver and/or onPointerOut (users often like “button-hover” stuff), perhaps use those actions to **ONLY** change the size/color of the **white border plane**. It is difficult to change things upon the dynamicTexture with over/out, or ever.

Generally speaking, after making a dynamicTexture… DO NOT try to modify it, unless you completely REPLACE it. Wise advice for you, I believe. 🙂

* * *

If/when you wish to make MORE buttons with different text… you will need to adjust many things.  
Each button of this type… needs lots of work to make. Each button PLANE also needs a _unique_ name, too, so its _executeCodeAction_ (its click-event handler) knows WHICH button was clicked.

Perhaps you can build a universal _makeButton(lots\_of\_params)_ function that makes many perfect buttons… if you need many. Hard work. This is why many people dislike using dynamicTextures. You have to be an expert in [context2d specification](https://www.w3.org/TR/2dcontext/), which also sucks (to learn).

Reading it… can cause brain tumors. 😃 Good luck. As a reminder to others… @Ilyes_ELAYEB cannot use GUI 2d because of compat issues with his/her AngularJS version… used in his/her project.

* * *

You may have one other option… for buttons. Perhaps use HTML buttons… that have their CSS set to _position: absolute_ and then use their CSS _top_ and _left_ properties… to put the buttons in the proper place. IF your scene allows mousewheel zooming or mouse-drag mesh rotating… HTML buttons can be big problems.

Also, I hear that most VR headgear/goggles have troubles with HTML buttons, but I have not tested.
