You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is dependent on #49 and will probably require us migrating to a more feature-rich/mature GUI library.
Turtle already provides several different ways for you to get input. Not only can you use things like io::stdin to read input from the terminal, you can also poll events from the window and respond to them as you see fit.
The problem with getting input from the terminal is that it requires you to switch between the application and the terminal whenever you want to do something. This is especially problematic in applications which work best when maximized or fullscreen. Trying to use events alone doesn't allow the user to see what they are inputting (especially since we don't support text rendering yet).
We want to support something that is slightly simpler than the utilities provided by Rust's io module. Our input method would be tightly integrated with our library and actually have its interface on screen within the window itself.
The Concept
The overall concept is a sidebar chat window that pops up whenever a Turtle asks for input. The turtle's name (usually "Turtle" followed by a number if there is more than one turtle) is put before its messages. Your messages are right aligned.
New methods to be added to Turtle:
fn read_input(&mut self) -> String
Read an input message from the sidebar, this may be more than one line of input
If the input sidebar is not yet open, it will be opened and the text field will gain focus
fn say(&mut self, &str)
Write the given message to the sidebar, the message can be over multiple lines
If the sidebar is not yet open, it will be opened but focus will not change
say!(turtle, ...)
Similar behaviour and implementation to the write!() macro.
With this feature added, it would definitely be desirable to be able to get and set the name of each turtle. This is definitely not necessary for the implementation of this feature and can always be added later.
The text was updated successfully, but these errors were encountered:
This is dependent on #49 and will probably require us migrating to a more feature-rich/mature GUI library.
Turtle already provides several different ways for you to get input. Not only can you use things like
io::stdin
to read input from the terminal, you can also poll events from the window and respond to them as you see fit.The problem with getting input from the terminal is that it requires you to switch between the application and the terminal whenever you want to do something. This is especially problematic in applications which work best when maximized or fullscreen. Trying to use events alone doesn't allow the user to see what they are inputting (especially since we don't support text rendering yet).
We want to support something that is slightly simpler than the utilities provided by Rust's io module. Our input method would be tightly integrated with our library and actually have its interface on screen within the window itself.
The Concept
The overall concept is a sidebar chat window that pops up whenever a Turtle asks for input. The turtle's name (usually "Turtle" followed by a number if there is more than one turtle) is put before its messages. Your messages are right aligned.
New methods to be added to Turtle:
fn read_input(&mut self) -> String
fn say(&mut self, &str)
say!(turtle, ...)
write!()
macro.With this feature added, it would definitely be desirable to be able to get and set the name of each turtle. This is definitely not necessary for the implementation of this feature and can always be added later.
The text was updated successfully, but these errors were encountered: