-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cosmic text 0.11 #124
Cosmic text 0.11 #124
Conversation
i should really put them somewhere else on my machine
src/lib.rs
Outdated
#[derive(Component)] | ||
pub struct CosmicEditor(pub Editor); | ||
#[derive(Component, Deref, DerefMut)] | ||
pub struct CosmicEditor(pub Editor<'static>); |
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.
👍
Example |
Let me try to test |
It's white screen for me :) but I see some widget text in console |
lots of cloning but seems to be the only way if buffers are in the ECS editor widgets don't relayout when edited, but when unfocused the buffer does
editable banana, nice :D |
uhoh it's looking like im using the not a starting point pr as a starting point lol
@bytemunch we need to have some plan how bring this branch into main... what the scope of tasks we have to deliver to make it work, any ideas? :) |
Updated the PR message with a checklist (from the top of my head, I'm sure there'll be more to get done but so far unknown unknowns) Hopefully most of the work can be easily reimported from the main branch, but with so many code changes already compatibility is uncertain. Feel free to edit the checklist with anything you can think of that I have missed, lmk if this scope sounds appropriate |
What comes to mind... would be cool to have another thing is ab_glyph that used for text rendering in bevy can give position of "text curves" to draw text in 3d... would be cool to know whether cosmic-text can give the same thing.... another thing is trying to marry vello + cosmic-text + bevy to use GPU for text rendering.. if it's not feasible we could think about how we can speed text drawing up... maybe to use rayon to utilise all CPUs for pixel calculation. |
Yeah that sounds like a more maintainable way forward, though I do find the bevy plugin dependency issue pretty difficult to work with. Maybe for now we could use internal plugins in the same crate (lose for binary size but makes plugin interop a non issue), and once bevyengine/bevy#69 is fixed split modules out to their own crates? Binary size issue can be addressed with feature flags for toggling internal plugins on and off. Dropping scope to a core module is a great move though, unix philosophy and all that. |
Yep, internal plugins sounds good. |
adds a util crate for common example systems also removes history tracking structs
MV `bevy_api_testing.rs` > `sprite_and_ui_clickable.rs`
simplifys API and mirrors Bevy's Text functions more closely
so close no matter how far :) |
…evy_cosmic_edit into testing_cosmic-text_0.11
Aah i have duplicate commits from working offline 😆 Just pushed cos I couldn't figure out how to marry them >.< |
@bytemunch could you elaborate on "Fix setting a FocusedWidget"? |
Yeah I'm trying to sort it now, it's a systems ordering issue that means that sometimes a widget that should have text in it that is focused at startup appears blank. Currently fixed in all examples by never starting with a focused widget. I don't think it's too important to start up with focus, but I don't know if the issue would persist in a scene change or something similar where auto-focus is desirable. Now I've written that I realise it's because I'm setting the focus in |
Got it :) was letting |
Makes sense.... good job 👍 Just throwing some info at you :D I made a small check yesterday: it's indeed possible to get outline curves using |
Definitely something to look into, could be better for both perf and rendering. I'll throw some ideas back lol. If we can somehow make the rendering itself an (internal) plugin then creating a mesh renderer would be simpler. Figuring out how the upcoming internal plugin architecture works should show if and how such a system can work. I'll try implementing placeholders and password fields as plugins after this PR meets goals, that should set the groundwork for a pluggable renderer. |
Yeah, abstracting renderer sounds cool 👍 Then, |
There is tiny bug: when widget becomes active cursor first jumps to the beginning of buffer then on desired position but I think we can live with that |
Yeah I noticed, will have to time it to find out more, if it's a single frame delay then it could be a systems ordering thing |
Updates
cosmic-text
to 0.11, rips out inbuilt functionality in favour of a more modular design.Todo before merging:
FocusedWidget
before widget instantiation (i.e inStartup
)(And whenever needed, dynamically setting text doesn't update)Embrace regression, create modularity
- [ ] Reimplement placeholders- [ ] Reimplement password fields- [ ] Reimplement undo/redo- [ ] Check for other regressions