Can you make a custom button instead of using key events as toggles?

Right now I have a few key events to toggle settings such as depth testing and night/day lighting on and off. This works well, but it might not be the most user friendly way to go. I was wondering if there is a way to build my own buttons to toggle these events. Similar to how there is a “home” or “imagery picker” buttons in some of the examples. I’m still fairly new to javascript, but if you can point me in the right direction I’d really appreciate it!

Thanks,

Chris

What about using addDefaultToolbarButton like in this example?

That is exactly what I was looking for. Thanks!

I should point out that there is nothing special about the Sandcastle addToolbarButton functions. All they do is use the normal browser API to create HTML elements programmatically and insert them into the DOM.

You can create your own UI buttons using any framework (jQuery, Backbone, Dojo, etc.) you like, or without a framework.