Native text fields in HTML build?

20 views
Skip to first unread message

Paul Gestwicki

unread,
Apr 14, 2016, 7:59:03 AM4/14/16
to PlayN
I wondered if anyone had a trick for using native browser text fields within a PlayN+TriplePlay application compiled to HTML. It would be nice to not have to deal with pop-ups.

Paul Gestwicki

unread,
Apr 14, 2016, 10:25:08 AM4/14/16
to PlayN
For what it's worth, we're currently experimenting with placing native text input fields on top of a TriplePlay element. Right now, we just have some proof-of-concept code, not enough testing or integration to see if it will reliably work. If someone had a pre-packaged or shorter solution, it would save us some time. 

Michael Bayne

unread,
Apr 14, 2016, 10:35:23 AM4/14/16
to pl...@googlegroups.com
On Thu, Apr 14, 2016 at 4:59 AM, Paul Gestwicki <paul.ge...@gmail.com> wrote:
I wondered if anyone had a trick for using native browser text fields within a PlayN+TriplePlay application compiled to HTML. It would be nice to not have to deal with pop-ups.

We did some work with this on the Java/AWT, Java/SWT and iOS backends, but didn't do it for HTML5. I would highly recommend plugging into the work that we did though, because then you'll get iOS text field overlays for free. The Java overlays unfortunately suffer from a bunch of problems with AWT/Swing interacting with OpenGL and SWT interacting with OpenGL. The SWT stuff can be made to sort of work, but I think the AWT/Swing stuff is hopeless.

Anyway, the code is in tripleplay:


Michael Bayne

unread,
Apr 14, 2016, 10:36:40 AM4/14/16
to pl...@googlegroups.com


Ha, looking at that, it hasn't been updated for RoboVM. That's unfortunate but wouldn't be super hard to do.


kal...@gmail.com

unread,
Apr 15, 2016, 2:28:05 AM4/15/16
to PlayN
Honest question: why is it so important to have native text fields, why not create a textfield class for TriplePlay that has customizable looks, handles key input, etc.
A lot of game engines use this method (Unity for example) and it's fine, even on mobile.

Andres Martinez Quijano

unread,
Apr 15, 2016, 7:43:05 AM4/15/16
to pl...@googlegroups.com
Here's the answer:

https://github.com/threerings/tripleplay/commit/f7e4a9150f7be445484b097f73bf89c907c8b1a5
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "PlayN" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to playn+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Daniel Kalmar

unread,
Apr 15, 2016, 7:55:32 AM4/15/16
to pl...@googlegroups.com

Alright, I get it. Still, I could see a middle ground with some basic functionality that is enough for the most common use cases like username, password, age or date of birth, etc.


You received this message because you are subscribed to a topic in the Google Groups "PlayN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/playn/pUC7dgPhq8M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to playn+un...@googlegroups.com.

Andres Martinez Quijano

unread,
Apr 15, 2016, 8:04:07 AM4/15/16
to pl...@googlegroups.com
I ended up doing just that, a subclass of the old textfield with
(very) limited features: no selection, no copy&paste, etc
Reply all
Reply to author
Forward
0 new messages