mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-18 17:35:57 +10:00
That was painful; hopefully since now it should be easier to have it in every WebGL example.
It's enough to add one line (ideally as the first thing that gets executed):
if ( ! THREE.Supports.webgl ) THREE.Supports.addGetWebGLMessage();
This will add message box with default styling centered near top of the window. Optional parameters "parent" and "id" can be specified for further customization and integration with the document, also message DOM element is returned for easier access.
var messageElement = THREE.Supports.addGetWebGLMessage( { parent: container, id: "my_message" } );
By default, message is added to document.body and has id "oldie" (can be styled with CSS).