Hi I am currently developing a game for android on unity. (2d game)
I've been looking for answers everywhere since a week but still no answer ... So I decided to ask here.
Actually my problem might be very simple but I am new to Android development and I had no idea of how it was walking.
1 - I want the input field right at the top of the keyboard to be hidden, to put a custom input field made with unity UI system.
2 - Adjust keyboard's position (Only for like 50px from the bottom of the screen) so that i can put my stuffs in there.
I get that keyboard appears automatically when an InputField is focused or selected. But it dosen't make disappear the input field from the native keyboard.
From what I learned serching , I get wether I need to make plugin for unity or export my unity project to eclipse to do so.
But unfortunetly I have no base on java or xml.
I should really learn at least basic skills on these stuffs but for now I can't afford to spend time to learn from base.
What would be the most easy way ?
Hope someone can help me out.
Thank you !
Maybe you can change the input field to just text,
And when you click on the text, show your own keyboard ui.
This is an alternative solution I think.
Related
I have been working on a libGDX project and was wondering if I could create a login screen with the use of some kind of text inputs. I have been looking all around for text input fields, but the only one I can seem to find are those that pop up, which I don't really want to use.
My project is a desktop game only and uses the screen implementations combinede with a game super class.
Is there any other way to get text input inside the window, so not as a pop up?
As said in the comment, the right way to make a login screen is to use Scene2d.ui and its TextField. Check out the Scene2d.ui wiki page and Skin Composer to get going.
I am working on a research project.The scenario is this.
I am taking the screenshot of my desktop and then I process it using an API to get the position of a certain text on my Desktop.e.g , say I have the browser open on my desktop and I am on stackoverflow.Now I want to search the position of the logo stackoverflow on the screenshot taken.Then I want to simulate a click on it.I am using Java platform.
Now I have 2 questions:
1)Is there any free API(OCR) which I can use to process the screenshot to fetch text position (or can be done by some trick) and gives good results.
Or Any way you can suggest that I can use (instead of taking screenshot and processing it) to get the position of any text on the screen.
2)How can I simulate the click on the screen using the code by a background program running(I mean I have done it in Swing and other language UIs but this time its different as Now I want to click on the screen.
If I understood you right you want to move your mouse and click on the screen. That not that hard you could use the robot class from Java!
For example:
Robot rob = new Robot();
rob.keyPress( KeyEvent.VK_ENTER );
or what ever, there are so much bottons and movements you could with it. A list of all methods you find here.
And your other question I can't answer. I think there is no API that is able to search a text and give you the position. But what I know is that the robot class is able to capture the screen and put it into a BufferedImage. With it you could compare two pictures.
Maybe you could get use of this but I don't know if it is what you search.
I want to create a timeline-based editing GUI in java - in the style of a video-editing software (such as adobe premiere for example). Below is an image, how I have the GUI in mind (sorry for not including it directly - as a new user that feature is disabled):
Whats currently implemented is just the timeline-slider at the top (with JSlider) - all the rest is just made up with Photoshop (also the black-line that goes down from the slider, through the layers).
Now my question is not very specific, I just wanted to get some input how I could implement the rest as nice as possible. To be a little bit more precise, I would appreciate hints to the following topics very much:
How to organize the whole gui - concerning the time indicator-line
which goes from the top to the bottom through all the layers?
How to visualize the waveform, are there good (and free) packages
that can be used? (audio files are either MP3 or WAV)
Which element to use for the text-segment layers (they should be draggable & droppable somehow) -> JLabels, JButtons, how to best solve the drag-n-drop feature?
You see I have still some work ahead of me, any good advice or point to the right direction would be very kind!
For the waveform issue you could take a look to this question and the accepted answer. The class creates a PNG image file, but you should be able, instead of saving the image, just display it in your programm.
The drag n' drop thing is well explained in this tutorial by Oracle.
I would like to create a quiz for my Java GUI.
I'd like it to display a question on one page, then have a next button which takes the user to another page telling them if that question was correct or not, and if it is correct they can move on to the next question (by clicking another next button) and if they got it wrong, have to go back and answer it again. However I have no clue how to do this!!
So far I have a simple GUI with a welcome page and tabs down the side, one of which includes a quiz. Would it be a better idea to create the quiz in Flash or something and then embed it into my Java application? Or just do the whole thing in Java? I'm really new to java so I'm not at all sure what to do, any help would be greatly appreciated!
Thanks
It would be best to use just Java. Consider using CardLayout with your GUI to allow swapping questions, or else you can create and modify key components on the fly such as the text displayed by JLabels and JRadioButtons.
Key though before considering any GUI structures is to first create solid OOPS based non GUI classes to handle your questions. For instance, you may want classes for:
Question class that holds a question String, a List of possible answer Strings, a correct answer String. This class can randomly order the incorrect and correct answers, can have a method for checking if the answer selected is correct.
A Test class that holds a collection of questions, that can present questions in random order, that can hold the score obtained.
A QuestionReaderWriter class that can read and write questions to a text file (you definitely do not want to hard-code the question text).
For this type of app it would be best to use the language you are more familiar with.
Since this is just a simple display this then do that there really is nothing very difficult about it.
Personal, I would lean towards Flash as the flash IDE is drag and drop and an experienced flash guru could make this in a few hours. Flash IDE is geared towards this.
...similar to those produced by email clients like thunderbird or outlook, sliding up or fading in from the tray.
The simple popup: Look at http://jtoaster.sourceforge.net/
For the fancy stuff look at what Java 2D can do:
http://java.sun.com/products/java-media/2D/samples/java2demo/Java2Demo.html
Check Composite -> Composite FadeAnim.
What are your notifications for? Is it for a program that already exists, or are you writing a new application?
I ask because Adobe AIR has some functionality for doing this sort of thing, either as a Flex based application, or an AIR application written in HTML/JS. But, you wouldn't use AIR unless this is something you were building from the ground up.
Swing's Timer class (http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html) can be used for rudimentary animation - just use the timer to update the location of the panel containing your content.
I attended a JavaOne session last year where they did some pretty slick stuff with this.
Slides : http://progx.org/users/Gfx/FilthierRicherClientier.pdf
pay special attention to page 29 and on.
And here's a website from the same folks, but with more code and screenshots, etc...
http://today.java.net/pub/a/today/2007/10/23/create-moving-experiences-with-animated-transitions.html
The end result of all of this was very, very slick.