How to create a input text field?

2,583 views
Skip to first unread message

flashzone

unread,
Aug 1, 2012, 9:53:43 AM8/1/12
to eas...@googlegroups.com
I want to create a input text field by createJS. Any ideas? Thanks.

flashzone

unread,
Aug 3, 2012, 11:22:16 AM8/3/12
to eas...@googlegroups.com
No solution in easeljs? 

Grant Skinner

unread,
Aug 3, 2012, 11:40:52 AM8/3/12
to eas...@googlegroups.com
EaselJS does not support text input directly (canvas is a poor medium for text in general, and particularly input). The ideal solution is to position an HTML text input over your canvas content. You can do this quite easily by using the DOMElement to treat your input (or a surrounding div) as a display object.

I believe there are some examples of this floating around, perhaps in the archives of this list. I might try to toss one together in the examples as well, since this gets asked every so often.

Cheers,
Grant.

Fabio Biondi

unread,
Aug 19, 2012, 8:54:03 AM8/19/12
to eas...@googlegroups.com
Yes an example would be very appreciated.

When I overlap a canvas with HTML elements I see some strange blink effects on the canvas object.
This only happens on mobile devices (I tried on IOS,  Android and BB Playbook), while it works very well on desktop browser.

For example, if I need to open a video player or a contact form above the canvas I simply create and move a DIV above the canvas using a  tween engine (i.e. TweenMax JS).

Maybe it's not the best way to do it but as you know my background is AS3 and I'm not very good on "classic" HTML stuff : )

Thanks in advance
Fabio

Robert Fiedor

unread,
Oct 17, 2012, 12:38:05 PM10/17/12
to eas...@googlegroups.com
hi Grant,
I followed your advice but ran into this...

So i ran into this strange thing where I have an app that's created using easelJs, ported to iphone using phone gap, and although it all takes place on canvas I do actually have one html text input field on top of everything. The app works fine, but when i try to insert something into the text field, i notice that the frame rate drops and my canvas element starts behaving choppy...

it happens as soon as I click on the input field (the keybord slides out, I am able to insert text, that part looks good), but it's just the canvas element that's acting up on me here... and this frame drop continues even after i take the textfield off...

anyone ever ran into something similar?

On Wednesday, August 1, 2012 9:53:43 AM UTC-4, flashzone wrote:
Reply all
Reply to author
Forward
0 new messages