This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-12-08 23:43:12

jmck75
New Scratcher
Registered: 2011-08-23
Posts: 4

word processing

Hi,
Hoping for someone with more brains than me  smile 
I am having problems when trying to complete a small word processing code, I have managed to design each letter and they display well enough. However I can't figure out how to stop my forever block sending the sprite off screen  sad  I have got it so I can type the first letter, then move to the start position for the next but then it moves before i type  sad   
Anyways, I have no doubt made little sense here but hopefully someone will get the gist of what i mean  smile

Cheers in advance

Offline

 

#2 2011-12-09 00:52:38

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: word processing

could you upload the script?
it's probably an easy fix with one or more 'repeat until', but i should see the source in order to help more  smile

Offline

 

#3 2011-12-09 03:23:24

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: word processing

Maybe make it so if the x position of the sprite is over a certain number it starts a new line?  smile


Why

Offline

 

#4 2011-12-09 11:11:22

jmck75
New Scratcher
Registered: 2011-08-23
Posts: 4

Re: word processing

[blocks]<when green flag clicked><clear><set pen size to(3)<pen up><go to x sad -220)y:(140)<point in direction(90)<forever> <if><(<x position>  <>>-220  )><change{numberpressed}by(1)<pen up><go to x sad (( <x position> <+> 20 ))  )y:(140)[/blocks]
hopefully posted it correctly  wink 

cheers guys

Offline

 

#5 2011-12-09 11:20:34

jmck75
New Scratcher
Registered: 2011-08-23
Posts: 4

Re: word processing

[blocks]<when green flag clicked><clear><set pen size to(3<pen up> <go to x sad -220  )y:(140<point in direction(90<forever>  <if><( <x position> <>>-220  )><change{key pressed  }by(1<pen up> <go to x sad ((<x position>  <+>20  )) 140 )y sad  [/blocks]

Offline

 

#6 2011-12-09 11:36:02

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: word processing

jmck75 wrote:

[blocks]<when green flag clicked><clear><set pen size to(3)<pen up><go to x sad -220)y:(140)<point in direction(90)<forever> <if><(<x position>  <>>-220  )><change{numberpressed}by(1)<pen up><go to x sad (( <x position> <+> 20 ))  )y:(140)[/blocks]
hopefully posted it correctly  wink 

cheers guys

If you've solved it, then I'll request this topic to be closed.


Why

Offline

 

#7 2011-12-09 12:51:18

jmck75
New Scratcher
Registered: 2011-08-23
Posts: 4

Re: word processing

no still no joy  sad
it still continues to move before the next letter is typed  sad   
Don't know what i am doing wrong


any ideas mate ? 
much appreciated  wink


cheers

Offline

 

#8 2011-12-09 18:39:58

fuz50
Scratcher
Registered: 2008-09-19
Posts: 100+

Re: word processing

Maybe you should upload the project so we can see it in action?

Hope we get to a solution here.  wink


http://img10.imageshack.us/img10/7404/cooltext529102298.jpg
http://siggen.toontown-click.de/sig1.pnghttp://siggen.toontown-click.de/sig2.png

Offline

 

#9 2011-12-09 22:45:25

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: word processing

Try using a script like this:

When [green flag] clicked
Forever
  -insert letters a-y script here using the below "z" as a template-
  if <key z pressed>
    switch to costume [z]
    stamp
    change [x] by [10]
    wait 0.1 seconds
  end if
- only put in the following once -
  if < ( x position ) > ( 170 ) >
    set [x] to -170
    change y by -10
  end if
end forever

Obviously, duplicate the code I used for the letter "z" for letters a-y, as well - but that should work fabulously. It even resets the cursor at the end of the line! I haven't tested it, but it's likely to work. If you need any more help, just call upon me and I'll do my best.  smile

Offline

 

#10 2011-12-10 11:21:58

Venazard
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: word processing

There are also some word processor Scratch projects that have this. Go here and here here for examples of projects who have completed this type of task. You can download them to find out the exact coding they used. Hope that helps!


http://nitrostudios.weebly.com/uploads/6/8/1/2/6812574/1323469851.png

Offline

 

#11 2011-12-11 11:52:31

SenseUser
New Scratcher
Registered: 2011-12-11
Posts: 1

Re: word processing

This is an assignment using Sense for the Open University course TU100

Offline

 

Board footer