in4ray / firefly-sdk

Firefly - in4ray Gaming SDK
http://firefly.in4ray.com
Other
54 stars 11 forks source link

SoftKeyboard Component #22

Open VladimirCores opened 10 years ago

VladimirCores commented 10 years ago

I want to use Softkeyboard for my game, based on http://cote.cc/projects/softkeyboard. So i want to realize it with your framework entities. Could you help me to do so?

rzarich commented 10 years ago

Try to use our component com.in4ray.gaming.components.NativeText which invokes SoftKeyboard.

VladimirCores commented 10 years ago

Thank you. It's works! But do you know how can i manually trigger event to display native keyboard on ipad?

VladimirCores commented 10 years ago

this is my code at Class constructor: tfNative = new NativeText(1); tfNative.text = "HELLO WORLD"; tfNative.backgroundColor = 0xf1f1f1; tfNative.fillBackground = false; tfNative.editable = true; tfNative.textAlign = TextFormatAlign.CENTER;

Than: private function addedToStageHandler(event:Event):void { tfNative.assignFocus(); }

But it's not work, keyboard does not shown.

Instead of that i try to use only StageText like so: tfStage = new StageText(new StageTextInitOptions(false)); tfStage.editable = true; tfStage.stage = Main.STAGE;

private function addedToStageHandler(event:Event):void { tfStage.assignFocus(); }

And it's work fine, but it move everything up.

rzarich commented 10 years ago

1) You haven't capablity to invoke native keyboard manually. Focus should be on the text component and AIR manually invokes keyboard. 2) See param in the descriptor file softKeyboardBehavior which is responsible for moving stage.

VladimirCores commented 10 years ago

Thank you!

VladimirCores commented 10 years ago

I have a trouble with listening on the change event from StageText, it does not happen. Maybe you know any solutions for that?