How to show on screen keyboard on top of canvas? - unity3d

How do I show the on screen keyboard of mobile devices on top of the canvas in Unity3D? My canvas now shrinks in size because of the on screen keyboard, which is not what I want.

I don't believe there is an inbuilt feature for this you would have to do it manually using OnGUI(). To draw something on top of something else just put the script in the order you want it drawn. That means the last peice of gui script will be ontop.

Related

How to stop Screen Space Overlay canvas from blocking UI button presses on World Space canvas?

I'm using Unity 2022.1.23f1 and the Universal Render Pipeline. I have a render texture, set to 480x270 with point filtering, to get a cool pixelated effect. In my scenes, I output the camera into the pixelated render texture and render it in a raw image under a Screen Space Overlay canvas. This makes it so that everything is rendered in 480x270.
Everything worked perfectly fine in the main gameplay, as there aren't any UI buttons to press. However, in my main menu scene I have three UI buttons for starting the game, accessing the options menu and quitting the game. The main menu is in 3D, featuring a desk with a monitor on it. I thought it would be cool to have the UI buttons look like they're on the monitor, which is why I made a World Space canvas, where I positioned the three UI buttons on the monitor.
I thought it would be easy to make the buttons interactable, but they don't work. I'm sure it's because the pixelation effect is blocking the UI buttons on the World Space canvas.
I removed the pixelation effect, along with the Screen Space Overlay canvas which holds it, and the buttons worked perfectly.
I googled the problem and found someone saying to remove the Graphic Raycaster component in the Scren Space Overlay Canvas, but that didn't work. I also turned off "Raycast Target" in the pixelation effect's raw image gameobject, but that also didn't work.
Is there any way to make it so that I can interact with the UI buttons in the World Space canvas, while also having the Screen Space Overlay canvas with the pixelation effect? Any help - or even suggestions to make a better pixelation effect - would be appreciated!

How to change canvas' size in unity3d

I can not change canvas' size when it's in Screen Space - Overlay Mode; After some research I found that the size of a canvas is determined by your game's screen size. The canvas just covers your screen. So I think I could change my camera's size to change canvas' size. But it does not work. Does anyone know how to set a specific size to a canvas?
So may be my question should be how to change the screen size showed
in editor?
To change the screen size, go to the Game window (accessed by the menu "Window->General->Game"). At the top of the window will be a screen size menu (outlined in green, below) to change the screen size. When pressed, it will display the list of screen sizes that will be emulated. I say "emulated" instead of "displayed" because it is possible to have a screen size larger than the screen on which you are working. It is also possible to zoom into a screen. The "Scale" slider (to the right of the screen size menu) will allow you to scale up/down.
As a note, the list of screens and resolutions shown are related to the current build target (accessed by "File->Build Settings..."). For example, common iOS screen sizes are displayed in the list when the build target is iOS.
Use the Canvas Scaler Component
Unity3D Documentation: Canvas Scaler

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

Non full screen keyboard in Unity 3D

I've seen games all around for android that allows you to type in-game. In landscape mode, the android keyboard would come up and take approximately only half of the screen.
On unity, this is not the case. If you call the keyboard on landscape mode, the full screen will be covered by the keyboard.
Is there a way that pushes up the 'half screen' keyboard?
You Can use Unity Ui in unity 5.2 which has Input Field Component
Work as an TextBox . As you will click on input field it will automatically call keyboard.
https://docs.unity3d.com/Manual/script-InputField.html
Half screen will be for keyboard and half will be your text area to write.

make a background work on all iphones ios

I've just begun playing around with XCode and currently reading on Objective-C!
I have made a dark background and a book-ish "background" on top of it. Example here.
But how do I set it in a constant position on every iOS device and every iPhone screen-sizes?
From the looks of your image I assume that you want it to be fixed to the bottom.
To do that place your image view in the bottom of its superview and change the autosizing to be fixed to the bottom like in this image below.
The little red box in the view labeled "example" shows you how the image view will behave when the superview is resized.
If you want your image view to have a constant position anywhere else, just position it where you want it and set the appropriate autosizing for it (once again, look at the red box to see how it will behave when resized).
If the right pane is not visible press the right pane button in the tool bar (image below) or use the keyboard shortcut ⌘+⎇+0 to display the right pane or ⌘+⎇+5 to go directly to the size inspector.