How to disable the cceditbox moving the whole scene to accommodate a keyboard - cocos2d-x

I've used the editbox in my game to handle the input.But there is a thing done by the system that the whole game scene is moved up to accommodate the soft keyboard.Any help is appreciated.

Related

Cocos2dx scene in child window

The application I am writing is not a game, but does require many of the features one would use in a game... displaying a 2D scene, moving the camera to pan and zoom, rotating or otherwise animating objects within the scene. But the display of the scene will be controlled via numerous regular windows controls.
The best comparison I can think of right now is a level editor. The majority of the user interface is a standard window with panes that contain different controls. The scene is contained in another child window. When the user makes adjustments such as camera location, the scene responds accordingly.
So far, everything I've seen about cocos is geared around a single window. Is it possible to embed a scene into a child window as I've described?
You can add your custom layer to your main scene using Director::getInstance()->getRunningScene()->addChild(...) function

Flash Game objects won't go away

I have a flash movie with a interactive game in the middle. The game is a simple drag and drop with a target.
Now to my problem:
When the user plays the game the drag and drop symbols stays in the target spot on the next frame to the end of the movie.
I would like them to disappear after the game is over.
I am a noobie to actionscript 3.0 - is the a code i can implement on the frames after the game to make sure that the objects wont showup.
Thanks..
Frame navigation does not affect objects that were created by code (or even objects that were created by frames but modified by code). So you need to manually remove them via removeChild().

actionscript 3: calling function for second time wont work

I'm new to actionscript 3, I have sequences of frames and two buttons to control which sequence to play, it first works properly, but have problem when a sequence is being played for the second time. I have used gotoAndPlay function for my navigation. can anyone help me?
From your description I have a hunch about what may be happening...
Firstly I would ask you if the buttons are present at all frames along the timeline? If they are not (ie, sometimes the timeline shows a frame where the buttons are not present before returning to them ) you should realise that when they come back into view again, they are not the same buttons as the ones from before. That means that the event listeners you attached the first time are not going to respond to clicks on these new buttons.
This happens because flash always totally recreates timeline objects when they come into view again. Flash can sometimes cope with a "jump" over a "gap" when a symbol is the same, but this is extremely unreliable and should be avoided for this reason.
You can avoid this problem by keeping the ui on the stage at all times, and revealing and hiding the buttons when you need them. Even better, create an instance of your ui in code and add it to the stage when you need it. This way you know there is only one instance, and you are in control of it.

ActionScript 3 Best place to bind events

I am writing a small Flash game using air for android and have encountered a slight issue.
The game has 3 screens (excluding the game screen) which are main menu, load game & create new game. On the load game and create new game screens I want to add a button which take the user back to the main menu.
I know how to add event listeners to buttons but I am wondering where do I bind the event listener for back to main menu, binding in the constructor of my main class produces an error at run time and binding after going to the frame is knocking out the other buttons when back at the main screen.
At present the app is across multiple frames (probably a better structure to this instead of loading a single frame with each menu), I am new to actionscript so I am not entirely certain on best practices for this sort of thing.
Thanks.
I recommend you to use only one frame in your Fla, then use a Document Class. In that main Class, you should place all your display objects using ActionScript.
I hope you know how to instantiate Class as library clips.

How to make an object be ignored and letting mouse evnets pass through?

Hallo, I been having this problem for a while and I have no idea how to solve it.
I have a flash game (very much like a normal memory game) that has a lot of Movieclips in it that has MouseEvents attached to them. But, when I add a bitmap over the stage (used for covering lots of unwanted things and has to be there) that is the full size of the screen non of my events are fired anymore. The reason is that the overlay bitmap is stealing all of the events.
How can I stop this behavior? Is there a way of letting the events pass through the overlay object? Or for the overlay object to be ignored when it comes to events?
Thanks.
Assuming your overlay is stored in a variable m_overlay, then
m_overlay.mouseEnabled = false;
However you said it is used for "covering lots of unwanted things" so perhaps we need more information on what you are trying to achieve?
I've solved this in the past by creating "proxy" object to capture mouse clicks. The MCs under the bitmap aren't going to receive events.