-
Notifications
You must be signed in to change notification settings - Fork 450
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
New text input object #3191
New text input object #3191
Conversation
I've taken the quickest of glances at the source and this looks promising! Edit: Multiline should already be handled by FlxText |
- Regenerate text graphic when `passwordMode` changes
Also, fwiw, in fact not everything in the FlxInputText TODO needs to be done in the first pass either, my minimum requirement is whatever it takes to make people stop using addons and your |
@@ -19,6 +19,8 @@ class FlxInputText extends FlxText implements IFlxInputText | |||
public var hasFocus(default, set):Bool = false; | |||
|
|||
public var maxLength(default, set):Int = 0; | |||
|
|||
public var multiline(get, set):Bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was wrong, it's not in FLxText, but it should be... or at last input text shouldn't be different from FlxText in this regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I make a PR to add it to FlxText, or will you add it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure when i'll get to it, but i can
Alright, I'll update the to-do list accordingly. |
- Add `setSelection()` function - `FlxInputText` variables are now destroyed properly
- Added `scrollH`, `scrollV`, `bottomScrollV`, `maxScrollH` & `maxScrollV` variables - Return end of text if character isn't found at position
- Selection boxes are now clipped inside the text bounds - Simplified getting the Y offset of a line
- Fix scrollV not being able to be modified directly
what is "text scrolling", is that and "force case" something that should also go in FlxText? |
Text scrolling is being able to scroll the text horizontally and vertically (if all the text doesn't fit in the bounds of the sprite), which for FlxInputText the user can do by scrolling the mouse wheel or moving the mouse around while selecting text. I suppose it could also have some uses in FlxText independent of text input, maybe even the mouse wheel scrolling could be an optional feature for base FlxText (it seems to already be the case for OpenFL text fields).
|
if these features are already in ui.FlxInputText then adding them to FlxText would require a PR to flixel-ui for compatibility. so just keep doing it how you're doing it and we'll migrate these to FlxText some other time. thanks for the info |
- Selection sprites now just change their color instead of making new graphics - scrollH can now be modified properly as well - Word wrap no longer changes with multiline (multiline only affects adding new lines)
- Caret is now positioned properly with different alignments - Caret is now clipped inside the text bounds - Caret is now automatically resized when changing `bold`, `font`, `italic`, `size` or `systemFont` variables - Fixed crash when pressing down a key while there isn't a focused input text - Fixed selected text format overwriting the border color - Fixed caret not being visible when text is empty - Fixed selection boxes sometimes not being updated immediately - Added `useSelectedTextFormat` variable - Double press check is now when the mouse is released (same as OpenFL)
- Moved action callback types to an enum abstract
Unsubscribing for the moment, if you need me for anything, ping me please |
There's still a handful of things left so I think I'll just close the PR for now and reopen it once it's ready. |
After #3178 was opened and I figured that my original text input library just would not work with Flash, I've started making a new one from the ground up, which does not depend on any internal OpenFL functions/variables.
It's still a work-in-progress as of now, you're free to request any changes of my implementation.
Showcase of its current state:
FlixelTesting_FmhZzLjwDU.mp4
To-do list: