sbiermanlytle / iioEngine

iio Engine: A JavaScript game engine for HTML5 Canvas
http://iioengine.com
455 stars 81 forks source link

How to use HTML such as <input > with iio ? #41

Closed franklinzhanggis closed 8 years ago

franklinzhanggis commented 8 years ago

First, iio is a great engine for drawing in Web. I am student in China, and sorry for my poor English. My question is that I want use some HTML in iio because I want to use Chinese (iio.Text do not support Chinese), but it is banned. So how can I do~

jamessimo commented 8 years ago

What font are you loading in to use? Also make sure your files are being saved as UTF-8 as this can cause issues.

sbiermanlytle commented 8 years ago

you can access any HTML DOM element with standard JavaScript: document.getElementById('textbox') or with jQuery: $('#textbox'). Once you have a reference to the DOM element, you can access its text value.

iio.js is only useful for drawing on a Canvas, which is a type of DOM element. You are not restricted from using other DOM elements in addition to a Canvas, and you can overlay elements on top of the Canvas.

sbiermanlytle commented 8 years ago

reopen if you are still having trouble

franklinzhanggis commented 8 years ago

I have solved it, thank you so much.