-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java native text fields don't support animation #32
Comments
Bruno added a method to help with this: Field.updateNativeFieldBounds(). The problem is that the Field itself doesn't get re-laid out if the container its in doesn't change dimensions or style properties, and the Field only knows to move its native associate if it gets told to lay out. updateNativeFieldBounds() is kind of a band-aid. I'm not sure what the real answer is. |
Also worth noting: this is not specific to the java native fields. iOS fields would have the same problem. |
"I told the Doctor, 'It hurts when I do this.'" There will always be a zillion rough edges when trying to magically keep a native field "in sync" with the scene graph that is hackily trying to pretend that the native field is a part of it. Games will just have to work around the original sin of native component hackery with more hackery. In the specific case of the screen transitions (which are definitely not the only place where native component rough edges will show), I plan to rewrite them to use the forthcoming "capture a scene graph into a texture" mechanism. This will, in theory, make this particular problem go away because the non-native Field will draw itself into the texture in lieu of the native field (and in theory it looks exactly the same), and then the whole scene graph (including the native field) will be destroyed and replaced by the big texture snapshot and the big texture snapshot will be used for the transition. This works around other issues like the fact that if you have a scene that contains clipped groups, FlipTransition and RotateYTransition don't work because they try to render the clipped group through a non-2D transform, which doesn't work. |
There's also the Field.FULLTIME_NATIVE_FIELD stye. I made it default to true for reasons that I no longer remember. Certainly, setting it to false for a field you want to animate will help a lot. Perhaps the default should be changed. |
I noticed in the demo after enabling the java platform, going into and out of the general tab shows the text fields fixed in place.
The text was updated successfully, but these errors were encountered: