How do I make a notepad program where I type something and a the letter goes on the screen without lists?
Offline
A sprite with each letter as a costume. Hide it. The next step I can't really explain w/o an example:
when gf clicked hide forever if (key A pressed) switch to costume (A) stampThen have the sprite move forward after each letter typed. If you wanted you could use a conditional variable regarding capitalization.
Offline
You'll have to make it move over a certain amount of "x" every character and then move down a line and start back on the left side too. This is easiest with monospaced font. Essentially, after stamping a character, the sprite moves over by the width of the character and, if it is over the right-most margin, it resets is x position to the left-most margin. I would also keep track of what is typed using a variable. If I could add to the above script:
when gf clicked clear hide set [text v] to () go to x:(left margin) y:(top margin) forever if<key [a v] pressed?> set [text v] to (join (text)[a]) switch to costume [a v] show stamp hide change x by ([width of a]+[2]) // the "2" is a slight buffer space between characters if<(x position) > (right margin)> set x to (left margin) change y by (((-1)*[height of text])-[height of vertical buffer]) end end if<key [b v] pressed?> set [text v] to (join (text)[b]) switch to costume [b v] etc. end if<key [c v] pressed?> set [text v] to (join (text)[c]) switch to costume [c v] etc. endThe above script won't accept key strokes like a "normal" text editor, but should still offer the general effect.
Last edited by MoreGamesNow (2012-12-12 21:55:43)
Offline
what is the etc.?
Offline
It means that the script used in the "if key a pressed" part is pretty much duplicated. Of course you'd change the width of the letter, but the rest of it should be pretty much the same.
Offline