i have a sort of typing script but it is not working to well sometimes it adds extra letters moves the letters to close or to far this is my script
when gf clicked set wordsx to -220 set wordsx to -100 clear wait 0.1 secs set toprint to No Accounts Detected broadcast type and wait
When i Recieve type go to x wordsx y wordsy set reader to 1 repeat <length of (toprint)> if <letter 1 of (toprint)=2> else switch to costume letter reader of toprint stamp wait 0.1 sec change x by 15 change reader by 1
Last edited by ZombieHappines (2012-08-18 22:51:24)
Offline
ZombieHappines wrote:
i have a sort of typing script but it is not working to well sometimes it adds extra letters moves the letters to close or to far this is my script
when gf clicked set [wordsx v] to (-220) set [wordsx v] to (-100) clear wait (0.1) secs set [toprint v] to [No Accounts Detected] broadcast [type v] and waitWhen I receive [type v] go to x: (wordsx) y: (wordsy) set [reader v] to (1) repeat <length of (toprint)> if <(letter (1) of (toprint))=(2)> else switch to costume (letter (reader) of (toprint)) stamp wait (0.1) secs change x by (15) change [reader v] by (1)
fixed scripts, but I don't understand what you're trying to do.
Offline
MoreGamesNow wrote:
ZombieHappines wrote:
i have a sort of typing script but it is not working to well sometimes it adds extra letters moves the letters to close or to far this is my script
when gf clicked set [wordsx v] to (-220) set [wordsx v] to (-100) clear wait (0.1) secs set [toprint v] to [No Accounts Detected] broadcast [type v] and waitWhen I receive [type v] go to x: (wordsx) y: (wordsy) set [reader v] to (1) repeat <length of (toprint)> if <(letter (1) of (toprint))=(2)> else switch to costume (letter (reader) of (toprint)) stamp wait (0.1) secs change x by (15) change [reader v] by (1)fixed scripts, but I don't understand what you're trying to do.
here is an example of what im trying to do but it doesnt come out right for some reason http://scratch.mit.edu/projects/ZombieHappines/2736800
Offline
The main problem seems to be spaces. I tried out this script and it seemed to work.
when I receive [type v] go to x:(wordsx) y:(wordsy) repeat (length of (to print)) if<not<(letter (reader) of (to print)) = [ ]>> switch to costume (letter (reader) of (to print)) stamp wait (0.1) secs end change x by (15) change [reader v] by (1) end
Last edited by MoreGamesNow (2012-08-19 11:56:25)
Offline
MoreGamesNow wrote:
The main problem seems to be spaces. I tried out this script and it seemed to work.
when I receive [type v] go to x:(wordsx) y:(wordsy) repeat (length of (to print)) if<not<(letter (reader) of (to print)) = [ ]>> switch to costume (letter (reader) of (to print)) stamp wait (0.1) secs end change x by (15) change [reader v] by (1) end
this still isn't working for me i don't understand why
Offline
ZombieHappines wrote:
this still isn't working for me i don't understand why
Do you have a space in the conditional?
(letter (reader) of (to print)) == SPACE
Offline
MoreGamesNow wrote:
ZombieHappines wrote:
this still isn't working for me i don't understand why
Do you have a space in the conditional?
(letter (reader) of (to print)) == SPACE
thanks it is still a little glitchy but great
Offline
ZombieHappines wrote:
MoreGamesNow wrote:
ZombieHappines wrote:
this still isn't working for me i don't understand why
Do you have a space in the conditional?
(letter (reader) of (to print)) == SPACEthanks it is still a little glitchy but great
You mean an "inconsistent spacing" kind of glitchy or still "printing wrong characters" kind of glitchy?
Offline
MoreGamesNow wrote:
ZombieHappines wrote:
MoreGamesNow wrote:
Do you have a space in the conditional?
(letter (reader) of (to print)) == SPACEthanks it is still a little glitchy but great
You mean an "inconsistent spacing" kind of glitchy or still "printing wrong characters" kind of glitchy?
If it's the former, use a list of the width of letters plus your spacing (some letters are different sizes), if its the latter it's probably costume naming or the iterating variable is changing too much/not enough/at the wrong time
Offline
MoreGamesNow wrote:
ZombieHappines wrote:
MoreGamesNow wrote:
Do you have a space in the conditional?
(letter (reader) of (to print)) == SPACEthanks it is still a little glitchy but great
You mean an "inconsistent spacing" kind of glitchy or still "printing wrong characters" kind of glitchy?
a little inconsistent
Offline
I've made my own take on this (wrapped in a text-based adventure for testing)
http://scratch.mit.edu/projects/plemon11/2734933
I solved the space problem by adding a list lookup for kerning, and using center offsets in the sprites to ensure that capitals, punctuations, and unusual cases (f,q,y) etc all sit on the correct horizontal plane. It works quite nicely (if I do say so myself!)
I plan on extending this to allow text on any arbitrary angle (even reverse) and with any scaling factor. One day!
PL
Offline
Yep, I used a list of spacings last time I had to do this too (I don't think I posted the project though)
Offline