How do i made notepad in graphics canvas? #2671
-
I Wanna made notepad in Cosmos, but when i use console.readline() cursor and any canvas redraw is shown when i press the key. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You should learn instead of asking for help. I'm sure you'd find an article on how if you searched |
Beta Was this translation helpful? Give feedback.
-
first, do not cram all your code into one file. it's already very big and i'm guessing you have troubles navigating it. do you have only one class? if so, split it and put into multiple files. second, use third, implement line wrapping if you didn't. it would be very hard to use notepad without ability to make multiple lines or wrapping them. and fourth, have fun learning things in Cosmos, there is a documentation where all APIs are written. |
Beta Was this translation helpful? Give feedback.
first, do not cram all your code into one file. it's already very big and i'm guessing you have troubles navigating it. do you have only one class? if so, split it and put into multiple files.
second, use
KeyboardManager
class to get info on key presses. unlikeConsole
class which waits for next key press,KeyboardManager
will not block your code. therefore, canvas would not stop rendering.third, implement line wrapping if you didn't. it would be very hard to use notepad without ability to make multiple lines or wrapping them.
and fourth, have fun learning things in Cosmos, there is a documentation where all APIs are written.