3 ms·
I really like coupling html and webgl, but thus far I've only done it the other way round: adding html on top of webgl. I did this in my last LudumDare game jam
by ensmotko 13y ago
I really like coupling html and webgl, but thus far I've only done it the other way round: adding html on top of webgl. I did this in my last LudumDare game jam [1]. I used html to render nice looking text on top of webgl. Although it's possible to render text within webgl it's messy, especially if you want bold or italic text, different fonts, colors etc.
[1] http://min.psywerx.net/ http://min.psywerx.net/
- bitteralmond 13y agoThis is pretty cool! Even as simple as this is, it shows how pretty webGL can be, and how it can play nice with DOM elements. Did you have much trouble getting the text to look right?
- ensmotko 13y agoThanks! I had no trouble at all with the text. I just created a centered div above the webgl canvas and loaded a custom font from google fonts. I believe I used jquery to accomplish all of this. It felt like cheating because there was no way I could make the text look this good within webgl under the time constraint (I only had 48 hours for the whole thing).
- pbhjpbhj 13y agoFWIW that page crashed my browser, FF22 on Kubuntu.
- ensmotko 13y agoI'm sorry to hear that. Do you have the same issue on other sites that use WebGL or just mine?