azerion / phaser-input

Adds input boxes to Phaser like CanvasInput, but also works for WebGL and Mobile, made for Phaser only.
MIT License
201 stars 64 forks source link

No cursor when added as child #4

Closed korroktheslavemaster closed 8 years ago

korroktheslavemaster commented 8 years ago

When I add the inputField as a child to a sprite, the blinking cursor stops showing. Everything else working as expected.

AleBles commented 8 years ago

The cursor is updated within Phaser's update loop, this calls the update function for all Phaser objects in the tree. By using addChild() you are going into PIXI territory and you loose the ability for using update(). You can manually resolve this by calling update() yourself on the InputField object.

korroktheslavemaster commented 8 years ago

Thanks for the reply, I've used InputField a lot. Could you please make it more clear in the readme how to add event handlers?

AleBles commented 8 years ago

Sure, You mean the keyboard open/close signals?

korroktheslavemaster commented 8 years ago

I mean callbacks for key presses. Also (as pointed out in another answer) a way to not have the enter key toggle keyboard.