Fixed indentation, fixed text overflow.
Showing the changes to examples/textInputOverlayExample.js (1 of 1 file). Show all
Unified · Split
| @@ -174,19 +174,19 @@ function updateWriting(deltaTime){ · 173 unmodified lines | ||
| 174 | 174 | cursor = "|"; |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | −// attempt at some overflow control of the text | |
| 178 | − if ((writing.length % (width/11)) == 0) { | |
| 179 | − writing = writing + "\n"; | |
| 180 | − } | |
| 181 | − // add blinking cursor to window during typing | |
| 182 | − var addCursor = writing + cursor; | |
| 177 | + // attempt at some overflow control of the text | |
| 178 | + if ((writing.length % 53) == 0) { | |
| 179 | + writing = writing + "\n"; | |
| 180 | + } | |
| 181 | + // add blinking cursor to window during typing | |
| 182 | + var addCursor = writing + cursor; | |
| 183 | 183 | if (clickedText == true){ |
| 184 | 184 | Overlays.editOverlay(inputWindow, { text: addCursor}); |
| 185 | − }else{ | |
| 185 | + }else{ | |
| 186 | 186 | Overlays.editOverlay(inputWindow, { text: writing}); |
| 187 | − } | |
| 188 | 187 | } |
| 189 | −//} | |
| 188 | +} | |
| 189 | + | |
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | // test keystroke against keyString and capture permitted keys |