Hello,
I'm trying to make a Windows XP simulator and I want to add a working word processor that lets you type straight on the window (a white sprite separate from the window itself). How do you do this?
WindozeNT
Offline
I would make one sprite with 26 costumes (each letter of the alphabet) and you can add numbers too.
Scripting:
Typing Letters (and Numbers):
When you press a button, for example the letter 'E' , change costume to 'letter E' -- Show -- Stamp -- Hide -- change x by (how ever many increments you need between the current letter and the next letter)
Spacing Script:
If key Space is pressed -- change x by (how ever long you want the space to be)
Script that acts as Backspace:
If key 'left arrow ' pressed -- set costume to 'White' (or the color of word processor background) -- change x by (how ever many increments to move back and stamp over a letter) -- show -- stamp -- hide
Hope this helps you out!
Last edited by coka (2010-07-09 12:17:07)
Offline
coka wrote:
I would make one sprite with 26 costumes (each letter of the alphabet) and you can add numbers too.
Scripting:Typing Letters (and Numbers):
When you press a button, for example the letter 'E' , change costume to 'letter E' -- Show -- Stamp -- Hide -- change x by (how ever many increments you need between the current letter and the next letter)
Spacing Script:
If key Space is pressed -- change x by (how ever long you want the space to be)
Script that acts as Backspace:
If key 'left arrow ' pressed -- set costume to 'White' (or the color of word processor background) -- change x by (how ever many increments to move back and stamp over a letter) -- show -- stamp -- hideHope this helps you out!
Can you show me that in Scratch blocks? I fail to understand it.
WindozeNT
EDIT: Where is the Stamp block...or how do you make a sprite "Stamp"?
Last edited by WindozeNT (2010-07-12 09:04:30)
Offline
WindozeNT wrote:
coka wrote:
I would make one sprite with 26 costumes (each letter of the alphabet) and you can add numbers too.
Scripting:Typing Letters (and Numbers):
When you press a button, for example the letter 'E' , change costume to 'letter E' -- Show -- Stamp -- Hide -- change x by (how ever many increments you need between the current letter and the next letter)
Spacing Script:
If key Space is pressed -- change x by (how ever long you want the space to be)
Script that acts as Backspace:
If key 'left arrow ' pressed -- set costume to 'White' (or the color of word processor background) -- change x by (how ever many increments to move back and stamp over a letter) -- show -- stamp -- hideHope this helps you out!
Can you show me that in Scratch blocks? I fail to understand it.
![]()
WindozeNT
What Coka showed you was much more a concept than actual scripting; essentially you need to switch to the costume of the key press and stamp.
Offline
coolstuff wrote:
What Coka showed you was much more a concept than actual scripting; essentially you need to switch to the costume of the key press and stamp.
So it's like this:
When [ a ] key pessed
{stamp}
switch to costume [ A ]
Change (X postion) by {number}
If <touching color [blue]?>
Go to x:{number} y: {number}
How do you stamp a sprite?
WindozeNT
Offline
WindozeNT wrote:
coolstuff wrote:
What Coka showed you was much more a concept than actual scripting; essentially you need to switch to the costume of the key press and stamp.
So it's like this:
When [ a ] key pessed
{stamp}
switch to costume [ A ]
Change (X postion) by {number}
If <touching color [blue]?>
Go to x:{number} y: {number}
How do you stamp a sprite?
WindozeNT
Just use the "Stamp" block in the "pen" category
And it should switch to the costume *before* stamping.
Offline
I have a problem. Every time I press a key, it doesn't stamp a copy; it just moves! I used:
[blocks]<when[ a ]key pressed>
<stamp>
<switch to costume[ A ]>
<change x by( 15 )>
<when[ b ]key pressed>
<stamp>
<switch to costume[ B ]>
<change x by( 15 )>
[/blocks] etc., etc., ect...
I've even tried this:
[blocks]<when[ b ]key pressed>
<switch to costume[ B ]>
<stamp>
<change x by( 15 )>[/blocks]
And this:
[blocks]<when[ b ]key pressed>
<switch to costume[ B ]>
<change x by( 15 )>
<stamp>[/blocks]
What's going on? How do I fix this?
WindozeNT
Offline
coolstuff wrote:
What Coka showed you was much more a concept than actual scripting; essentially you need to switch to the costume of the key press and stamp.
Exactly.
__________________________________________________
You are not the only one that can't just make a project by looking at worded directions with no pictures. What I recommend is looking at a word processor that is on Scratch already. If you can download it, look at the scripts, script your own project, and make it unique in some way, so that it is not an exact copy of the example processor.
(link to Word Processors on Scratch)
Last edited by coka (2010-07-12 11:20:41)
Offline
Well, I've already scripted mine, but I can't stamp the letters. The sprite just changes its X position by 15 and changes the costume. I dosen't seem to make use of the
stamp block. See above post.
WindozeNT
Last edited by WindozeNT (2010-07-12 11:35:40)
Offline
Here is the Word Processor project in a ZIP archive. What could be causing the unstamp? When I started, it didn't do this.
NOTE: Keep the red "obsolete!" block in there. It's in the stage and sprites. I want to add it in the list of control blocks but Scratch won't let me. Very rare block!
WindozeNT
Last edited by WindozeNT (2010-07-12 12:13:35)
Offline
Try putting the "stamp" below the "switch to costume [ v]" block Also, if the sprite is hidden, it won't stamp - if you want it to be invisible, but able to stamp, try setting the ghost effect to 100 (the block is in "looks") Hope this helps
Offline
Wolfie1996 wrote:
Try putting the "stamp" below the "switch to costume [ v]" block
Also, if the sprite is hidden, it won't stamp - if you want it to be invisible, but able to stamp, try setting the ghost effect to 100 (the block is in "looks") Hope this helps
![]()
I tried what Wolfie mentioned on the project already, but they did not work (sorry). I found the actual solution though! Read below:
At the moment with Scratch 1.4, you can only stamp onto the project's background, so you need to make sprite 3 (the notepad program) part of the project's background for the letters to appear in the program.
Last edited by coka (2010-07-12 13:00:02)
Offline
coka wrote:
Wolfie1996 wrote:
Try putting the "stamp" below the "switch to costume [ v]" block
Also, if the sprite is hidden, it won't stamp - if you want it to be invisible, but able to stamp, try setting the ghost effect to 100 (the block is in "looks") Hope this helps
![]()
I tried what Wolfie mentioned on the project already, but they did not work (sorry). I found the actual solution though! Read below:
At the moment with Scratch 1.4, you can only stamp onto the project's background, so you need to make sprite 3 (the notepad program) part of the project's background for the letters to appear in the program.![]()
Ah - I didn't download the project. I assumed that it was a case of the sprite stamping while hidden ^^
Offline
coka wrote:
coolstuff wrote:
What Coka showed you was much more a concept than actual scripting; essentially you need to switch to the costume of the key press and stamp.
Exactly.
__________________________________________________
You are not the only one that can't just make a project by looking at worded directions with no pictures.What I recommend is looking at a word processor that is on Scratch already. If you can download it, look at the scripts, script your own project, and make it unique in some way, so that it is not an exact copy of the example processor.
(link to Word Processors on Scratch)
this topic is at the top of the list
Offline
coka wrote:
Wolfie1996 wrote:
Try putting the "stamp" below the "switch to costume [ v]" block
Also, if the sprite is hidden, it won't stamp - if you want it to be invisible, but able to stamp, try setting the ghost effect to 100 (the block is in "looks") Hope this helps
![]()
I tried what Wolfie mentioned on the project already, but they did not work (sorry). I found the actual solution though! Read below:
At the moment with Scratch 1.4, you can only stamp onto the project's background, so you need to make sprite 3 (the notepad program) part of the project's background for the letters to appear in the program.![]()
That will be quite tedious, considering it will cause some simulation annoyances, since every application has a window sprite with it and I really don't feel like messing with advanced varibles and changing random things to "integrate" the window in the background. Anyway, it fixed it! Now all I need to do is get the letter spacing right and implement the ability to go to the next line when it reaches the end, like word wrap!
WindozeNT
Last edited by WindozeNT (2010-07-12 14:47:06)
Offline
If you wanted to make it so that the background could move, it would be quite difficult, but possible. You'd need to add each key press to a list, and then redraw the data from the list everytime the background moves. It's tedious and slow, but it's the only way
Offline
Looks like you guys have this pretty much solved. As for your word wrap solution, just do this:
When [a] key pressed: switch to costume [a] change x by (15) If x postion > (max x position} set x to (min x position) change y by (-15) stamp
That should work!
Offline
Harakou wrote:
Looks like you guys have this pretty much solved.
As for your word wrap solution, just do this:
Code:
When [a] key pressed: switch to costume [a] change x by (15) If x postion > (max x position} set x to (min x position) change y by (-15) stampThat should work!
![]()
Excellent! >:-)
WindozeNT
Offline
WindozeNT wrote:
coka wrote:
I would make one sprite with 26 costumes (each letter of the alphabet) and you can add numbers too.
Scripting:Typing Letters (and Numbers):
When you press a button, for example the letter 'E' , change costume to 'letter E' -- Show -- Stamp -- Hide -- change x by (how ever many increments you need between the current letter and the next letter)
Spacing Script:
If key Space is pressed -- change x by (how ever long you want the space to be)
Script that acts as Backspace:
If key 'left arrow ' pressed -- set costume to 'White' (or the color of word processor background) -- change x by (how ever many increments to move back and stamp over a letter) -- show -- stamp -- hideHope this helps you out!
Can you show me that in Scratch blocks? I fail to understand it.
![]()
WindozeNT
EDIT: Where is the Stamp block...or how do you make a sprite "Stamp"?
here, try this:
<when[d]key pressed>
<switch to costume[d]
<change x by( how ever many increments you need)
<stamp>
also, the stamp block is in the pen palete.
Last edited by jman13 (2010-07-17 17:09:30)
Offline