[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums :: View topic - Unable to create TextField
Slick Forums
http://slick.ninjacave.com/forum/

Unable to create TextField
http://slick.ninjacave.com/forum/viewtopic.php?f=21&t=4735
Page 1 of 1

Author:  ac99 [ Wed Mar 21, 2012 4:11 pm ]
Post subject:  Unable to create TextField

I have been trying to create a textfield on the screen but I always get an error saying that GameContainer should be casted to GUIContext.
I looked at the GUITest, followed it exactly as it was written there and ran into the same problem.

When I cast it, the application just crashes saying that GameContainer can not be casted to GUIContext.

Any help is appreciated.
Thanks

Author:  snakex20 [ Thu Mar 22, 2012 10:43 pm ]
Post subject:  Re: Unable to create TextField

Hello ac99, can I get the source code part when you are trying to create a textfield? I can help you better with that hopefully :? .

Author:  ac99 [ Fri Mar 23, 2012 12:51 am ]
Post subject:  Re: Unable to create TextField


Author:  snakex20 [ Fri Mar 23, 2012 4:03 am ]
Post subject:  Re: Unable to create TextField



Attachments:
font.png
font.png [ 8.9 KiB | Viewed 14678 times ]

Author:  snakex20 [ Fri Mar 23, 2012 5:19 am ]
Post subject:  Re: Unable to create TextField



Attachments:
font.png
font.png [ 34.81 KiB | Viewed 14676 times ]

Author:  davedes [ Fri Mar 23, 2012 1:59 pm ]
Post subject:  Re: Unable to create TextField


Author:  ac99 [ Mon Mar 26, 2012 4:55 pm ]
Post subject:  Re: Unable to create TextField

I copied and pasted everything everyone did and didn't have any success. I ended up with the same result of casting to GUIContext. I then thought about that the slick-ae.jar file that I have been using isn't made properly with textfield... so I removed the build path of slick-ae.jar and added slick.jar to the build path and surprisingly enough it works... No more errors!
I guess it's my slick-ae.jar file that has been causing the problem.

Thanks for the help everyone.
Next step for me... fix the slick-ae.jar file!

Author:  Mr. Kenkron [ Mon Mar 26, 2012 7:17 pm ]
Post subject:  Re: Unable to create TextField

i have not tested your code, but I believe that unicode font uses dynamic textures in the load glyphs method. By this i mean that the computer has to generate the image instead of loading it from a file. So far, I have not managed to get dynamic textures to work on android, but even if i could, there is a problem with dynamic textures on android. whenever the game loses focus, all of the textures are lost. when you resume the game, the textures loaded from files are automatically re-loaded, but dynamic textures are still lost. it may be possible to rebuild the texture when the game resumes, but is much easier to do what davedes recommended: use bitmap fonts.

Author:  davedes [ Mon Mar 26, 2012 8:02 pm ]
Post subject:  Re: Unable to create TextField

Both TrueTypeFont and UnicodeFont use AWT for font rendering... It's a wonder either would work at all on Android. :|

Author:  ac99 [ Mon Apr 30, 2012 3:09 am ]
Post subject:  Re: Unable to create TextField

I'm not sure what I'm doing wrong... but I tried to make a new slick-ae.jar file and i end up with the same problem i had at the beginning.
I also tried to use the gc.getDefaultFont() but I still end up with the same error: "cast argument gc to GUIContext"
(TextField is driving me insane!!!)

Thanks for all the input that has been coming.
Much appreciated.

Author:  mortias [ Tue May 01, 2012 8:43 am ]
Post subject:  Re: Unable to create TextField


Author:  ac99 [ Tue May 01, 2012 7:16 pm ]
Post subject:  Re: Unable to create TextField

Awesome, that fixed my problem with the GUIContext thanks mortias!

Now I've run into another problem. When I went to test the textfield on an android device, when selected it doesn't open the virtual keyboard. How would I go about getting the virtual keyboard to show up on when the textfield is selected??

Author:  mortias [ Wed May 02, 2012 8:17 am ]
Post subject:  Re: Unable to create TextField


Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/