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

#26 2011-07-20 01:46:01

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Tutorials-R-Us

So tutorials have to be text not a project?


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#27 2011-07-22 16:57:36

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

jji7skyline wrote:

So tutorials have to be text not a project?

If you could convert it over that would be great. if not, you can give us a link and ill put it in the useful links section


scimonster wrote:

Maybe I should get the pass.
You messed up on BBCode and grammar.  roll

Sorry  sad

Last edited by hello12345678910 (2011-07-22 16:58:44)


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#28 2011-07-29 18:03:21

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

bump


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#29 2011-07-29 23:05:24

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Tutorials-R-Us

my name is GP1 (as you can see) and I'm writing this Scratch tutorial for tutorials-r-us.
lets start with it. I'm going to show you how to make extra menus (ex. file, share) in Scratch.
1) Open the Scratch browser (giving that you know how to, otherwise shift-click the loop in the R of the scratch logo and clock fill screen off, then click the grey space on the side that appears and click open, then click browser)
scroll to scratch-ui-panes then scratchFrameMorph then menu/actions
2) clear the text in the bottom window and replace it with:

Code:

yourMenuGoesHereMenu: t1 
    | t2 |
    t2 _ CustomMenu new.
        "menu commands go here"
    t2 localize.
    #(1 2 ) do: [:t3 | t2 labels at: t3 put: ((t2 labels at: t3)
                copyFrom: 1 to: (t2 labels at: t3) size - 1)
                , ScratchTranslator ellipsesSuffix].
    t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)

3) replace the yourMenuGoesHere with the name of your menu (no spaces) but keep the Menu after the menu name with no spaces
4) to make a text in the menu, type in one line under the "menu commands go here" (click after the last " and press the enter) :

Code:

t2 add: 'The text (or command of the menu) here, but keep the single quotes' action: #theActionSelectorHere.

replace the text and the selector, keeping the ' and the # and the .
If you want to have the action do nothing (just text) then open another browser and browse to scratch-ui-panes>>scratchFrameMorph>>menu/actions and replace the bottom window with:

Code:

nothing

right-click on the text and click the accept button and replace the selector in the other browser (the one with the #theActionSelectorHere) and replace the #theActionSelectorHere with #nothing  (once you have the nothing typed in and accepted, you don't have to do it again)
5)if you want the text to do something, replace the theActionSelectorHere with a command with no spaces (ex. #command) then open another browser and go to the menu/actions (you probably know how to do it by now) and replace the text in the bottom window with:

Code:

command
"commands go here, look for them in another tutorial, they are not described here"

and replace command with the selector you used in the other browser (don't add the #).
6) if You want a line in between your commands, put:

Code:

t2 addLine.

7)right click and accept the browser with the yourMenuGoesHereMenu
8) in the third window to the right, click all, then scroll to createMenuPanel
9) find the line where it has:

t1 _ #( (#File #fileMenu:) (#Edit #editMenu:) (#Share #shareMenu:) (#Help #helpMenu:) ).

and replace it with:

Code:

t1 _ #((#File #fileMenu:) (#Edit #editMenu:) (#TheNameOfYourMenuNoSpaces #yourMenuGoesHereMenu:) (#Share #shareMenu:) (#Help #helpMenu:) ).

and right-click accept
10) shift-click the loop ion the R in the Scratch logo and click save image for end user, and click yes to save the image for the end user
11) restart scratch and your extra menu will be there
This is the end of the tutorial. I just found out how to do this, so I put it here.
http://i.imgur.com/A6ZBV.gif
http://i.imgur.com/Ux7pX.gif

Last edited by GP1 (2011-07-30 17:39:32)


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#30 2011-07-31 21:10:35

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Tutorials-R-Us

My name is GP1 and I'm going to show you how to use selector (#selectorNmae) code in Scratch.
Menu:
Simple codes
Simple codes
Here is an example of a selector code. I will explain it slowly after we read it.

Code:

moveSteps
| t1 t2 t3 |
t1 _ self ownerThatIsA: ScratchSpriteMorph.
t2 _ t1 xpos.
t3 _ t2+10;
t1 xpos: t3

This code will move the current sprite 10 steps.
Okay. Lets go through this now.
the moveSteps is the selector. It is called when another script does self or a menu has

t2 add: 'move current srite 10 steps' action: #moveSteps

Did you know?
self is a way to execute a selector in the same class. If a self is called with a selector afterwards in scratch-ui-panes,  then it will look for it in scratch-ui-panes only. The only way it looks for it in another class is if a variable is a world variable. We'll talk about these later.

Did you know?
a selector is a fancy way of giving a code a name. Like somebody giving their baby a name, then when their older, and they recognize their name, when you call it, they'll come to you (I hope)

the next thing is the temporary variables. These are defined in a pipe (|) and stop difining in another pipe(|). In this example, there are three temporary variables. the first is t1, the second is t2, and the third is t3. You can have as many temporary variables as you want in a code.
Next is a little different. first we call t1, then we are going to tell squeak that we are going to give it a value, wich is _. when you type _, it will turn into an arrow that points left. Don''t be alarmed by it. We are going to make it a global variable so that we can access all the blocks in scratch. We do this by calling self, then use ownerThatIsA: ScratchSpriteMorph. to tell it that the code we want is in scratchframemorph. usually, blocks are located in ScriptableScratchMorph, but motion blocks are only executed as a sprite (the stage can't move). Now that t1 is a global variable, it acts like a self exept only for the class that you assigned it to (ScratchSpriteMorph). We will further call t1 instead of self for this code.

Did you know?
the period is needed at the end of every statement to execute it. It is sort of like a seperator in a binder. You don't need a period at the end of the last statement, though.

We will now call t2 to set a value to it. in scratch, the x position block is called xpos in the browser, so we will use _ to set the value of t2 to that position. We will first (after _) use t1 to call xpos. This will be:

Code:

t2 _ t1 xpos.

next, we will set t3. This code moves the current selected sprite 10 steps, so we will give this variable the x position of the sprite moved 10 pixels (steps) to the right. We will call it, the use _ to assign the value to it. the first value we want is t2, thenwe want to add 10 to it. In math (yes, you should have stayed awake) you use + to add two numeric values together. So, we will add 10 to t2 by doing

Code:

t2+10.

Did you know?
There are four different math symbols:
/ devides (t1/t2)
* multiplies (t1*t2)
+ adds (t1+t2);
- subtracs (t1-t2)
But, if you want to add two variables of text together (or a variable and some text) the you use ,
example:

Code:

t2 _ 'world!'.
t1 = 'Hello ', t2.

will give t1 the value of "Hello World!"

Finally, we set the x position of the current sprite to t3. First, we call the global variable (t1) then xpos: t3.

Did you know?
xpos and xpos: are two different things. xpos sets a value and xpos: expects the value of wich to set the x position of the sprite. You could set a numeric value to xpos:, but it would count as a string, wich is inside of a pair of ', so it would be xpos: '0'.

There you have your first scratch frame morph code. Keep reading for more info and how to do more things.
I am sorry, I don't have scratch 1.4 on tis computer at this time. I will make the other parts of this tutorial later when I have it for reference.
http://i.imgur.com/A6ZBV.gif
http://i.imgur.com/Ux7pX.gif

Last edited by GP1 (2011-07-31 21:12:15)


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#31 2011-08-01 08:57:48

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

Oh I didnt notice that was a new one. Did you fix thE old one? I'm eating breakfast right now I'll add it when I have a chance.


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#32 2011-08-01 12:21:44

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Tutorials-R-Us

yes I fixed the old one


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#33 2011-08-01 12:34:30

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Tutorials-R-Us

Glad I could help!  wink

Offline

 

#34 2011-08-02 11:08:56

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

ProgrammingFreak wrote:

Glad I could help!  wink

Thanks!!
Thank you too, GP1!!


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#35 2011-09-02 21:55:47

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

Bump


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#36 2011-09-25 19:40:57

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Tutorials-R-Us

bump... Someone please write


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#37 2011-09-26 22:44:27

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Tutorials-R-Us

tongue  does it have to be related to scratch (ex. Scratch, squeak) or can I do something else, say XNA or html5?


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#38 2011-09-27 13:13:28

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Tutorials-R-Us

GP1 wrote:

tongue  does it have to be related to scratch (ex. Scratch, squeak) or can I do something else, say XNA or html5?

It has to be scratch. But it can be using scratch blocks, like a tutorial on how to scroll.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#39 2011-11-26 23:59:14

jurk
Scratcher
Registered: 2010-05-06
Posts: 100+

Re: Tutorials-R-Us

cool. I am still luring squeak but soon when I know enough I will help.


http://dl.dropbox.com/u/54228408/cool.png

Offline

 

#40 2011-12-15 13:07:35

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Tutorials-R-Us

i'll make another one soon.  big_smile


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

Board footer