Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
1177.11 Textures and Render-to-Texture
Even without extra packages, it is very simple to bring in basic interactive devices
including menus, sliders, text boxes, and buttons with just HTML and JS. For example a
button for a toggle can be done with one line in the HTML le:
<button id = "myButton">A Toggle</button>
and in the JS le we change a Boolean variable toggle by
var a = document.getElementById("myButton");
a.addEventListener("click", function(event){toggle = !toggle;});
In fact, we can do the equivalent with just a single line in the HTML, le but we prefer
to separate the page description from the action.
A slider is almost as simple. H
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079