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

#976 2010-12-26 10:26:28

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

hello12345678910, your submitted block has already been shared! Sorry!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#977 2010-12-26 11:06:32

kieru01
New Scratcher
Registered: 2010-12-06
Posts: 5

Re: Welcome to the OLD local block library!

Hi! i'm sorry to annoy you but i'm french and i don't understand how translate the block spec and code write in this topic to a block in BYOB or panther. I need some help ^^' i unfortunately don't understand the tutorials. I'm particulary insterested by the hide/show cursor block. Thanks a lot for yours answers

Offline

 

#978 2010-12-26 11:36:50

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Hey kieru01, welcome to Scratch. I speak German and Swiss but sadly not french, so you'll have to make do with an english explaination!

for BYOB:

You go to the BYOB part of the library and look at all the block pictures. When you see a block you want to make in BYOB yourself, click on the picture of the block. It will show you a picture of all the blocks that BYOB uses to make that block. You can then copy that picture into BYOB to make it work!

If the picture of the block has a blue arrow next to it, not a grey one, you can click on the arrow to download the block as a BYOB sprite on your computer!

For Panther:

open Panther.

Go to "variables" and go to the bottom.

click "make a block":
http://img521.imageshack.us/img521/9553/99941666.png

in the box, type "download block $Number$ from block library" and click OK:
http://img805.imageshack.us/img805/6205/78060984.png

In the new box, copy this code and paste it in to the big box:

Code:

|maker link t2 t3 t4|
link_'http://dl.dropbox.com/u/6273449/', t1 asString, '.txt'.
maker_self readLine: 1 FromUrl: link.
t1_self readLine: 2 FromUrl: link.
t2_self readLine: 3 FromUrl: link.
t4_self readLine: 4 FromUrl: link.
t4_self stringAsColor: t4.
t3_self readLine: 5 FromUrl: link.

createdBlocks at: t1 put: {t1. t1. '-'. ''. self class blockColorFor: 'custom'}.createdBlocks at: t1 put: {t1. t1. t2. t3. t4}.(t4 _ self ownerThatIsA: ScratchFrameMorph) ifNotNil: [t4 viewerPane categoryChanged: 'variables'].

self showInformDialog: 'sucess!' withText: 'The block has been added to your variables tab.', '
', 'The "', t1, '" block', '
', ' was shared by ', maker

so that your box looks like this:
http://img149.imageshack.us/img149/1879/87130624.png

Click OK.

At the bottom of the variable tab, you now have a http://img818.imageshack.us/img818/7799/48678810.gif block.

Go to the Panther part of the Library and look at the pictures of the blocks. When you see one you want, you will see that there is a green number next to it. This green number is a special number for that one block. Type that number into the http://img818.imageshack.us/img818/7799/48678810.gif block and then activate the block. The Panther block you wanted will now appear in your variables tab.


I hope that helps, if you don't understand something or have more questions, I'm here to help!  smile

Last edited by sparks (2010-12-26 11:41:32)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#979 2010-12-26 13:04:24

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

Re: Welcome to the OLD local block library!

MathWizz wrote:

Pecola1 wrote:

sparks wrote:

Pecola1, What are the square brackets in smalltalk code used for? I've always wondered. also, what are hashes used for? Such as #mouse and #edge above.

The hashes are like broadcast almost; it means that the computer will look for a code named whatever is after the #.
The [ and ] are (I am not really sure)  Like for conditions such as ifTrue: [^ true].

(I thought you were an expert?)

No, #selector is a selector. It is almost identical to a string.

I know but it also SELECTS different codes like broadcasting. That is how it is used in block specs.


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

 

#980 2010-12-26 13:12:27

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

...If the picture of the block has a blue arrow next to it, not a grey one, you can click on the arrow to download the block as a BYOB sprite on your computer...

I found out that sprites and projects are saved the as the same type, ysp.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#981 2010-12-26 13:23:40

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

SSBBM wrote:

sparks wrote:

...If the picture of the block has a blue arrow next to it, not a grey one, you can click on the arrow to download the block as a BYOB sprite on your computer...

I found out that sprites and projects are saved the as the same type, ysp.

Wrong, projects are YPR, sprites are YSP.


Yawn.

Offline

 

#982 2010-12-26 14:00:03

kieru01
New Scratcher
Registered: 2010-12-06
Posts: 5

Re: Welcome to the OLD local block library!

Thanks for your help Sparks, i have understand some things : i don't search at the good place.
So i have returned to the page 9 of this topic with the show/hide cursor.

sparks wrote:

http://img697.imageshack.us/img697/8903/37582851.gif
Shared by Pecola1[/b]
Blockspec:

('show cursor' #- #showCursor)

Code:

showCursor
    World activeHand showTemporaryCursor: nil

What it does:
Shows the cursor (use with hide cursor block below).

http://dl.dropbox.com/u/6273449/BlockLibDiv2.png

http://img339.imageshack.us/img339/6579/98858204.gif Shared by Pecola1
Blockspec:

('hide cursor' #- #hideCursor)

Code:

hideCursor
    World activeHand showTemporaryCursor: ((Form extent: 1 @ 1 depth: 32)
            fillColor: Color transparent)

What it does:
hides the cursor.

I have downloaded streak and I try to open the explication at :
http://scratch.mit.edu/forums/viewtopic.php?id=31200

but i failed to open the system browser T_T
So please, help me again ^^'

Offline

 

#983 2010-12-26 14:08:56

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Right, I'm not the best person to ask where the code for the show/hide cursor blocks go. If someone else could explain how to exit fullscreen, enter the browser and then add the code that would be superbe!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#984 2010-12-26 14:17:22

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

meowmeow55 wrote:

Wrong, projects are YPR, sprites are YSP.

Oh! I see the difference now. Opps... You must have changed it to a sprite.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#985 2010-12-26 16:10:08

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

Re: Welcome to the OLD local block library!

sparks wrote:

hello12345678910, your submitted block has already been shared! Sorry!

is it in the scratch blocks? because i don't see it...


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

 

#986 2010-12-26 16:13:43

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

You're right, it's under panther, but as the code is exactly the same, and several people have also submitted that one, I can give it to you as "converted to Scratch by hell012345678910"


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#987 2010-12-26 16:34:29

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

Re: Welcome to the OLD local block library!

sparks wrote:

You're right, it's under panther, but as the code is exactly the same, and several people have also submitted that one, I can give it to you as "converted to Scratch by hell012345678910"

OK. that's fine with me. also take these, please. they are 6 list blocks.

Blockspec:

Code:

('show list %L' #- #showList:) ('hide list %L' #- #hideList:) #- ('make private list %s' #- #makenewlist:) ('delete private list %s' #- #deletenewlist:) #- ('make global list %s' #- #makenewgloballist:) ('delete global list %s' #- #deletenewgloballist:)

Codes: (all under ListOps)

Code:

showList: t1 
    | t2 |
    self showOrHideList: t1 show: true.
    t2 _ self ownerThatIsA: ScratchStageMorph.
    t2 ~= self ifTrue: [t2 showOrHideList: t1 show: true]

Code:

 hideList: t1 
    | t2 |
    self showOrHideList: t1 show: false.
    t2 _ self ownerThatIsA: ScratchStageMorph.
    t2 ~= self ifTrue: [t2 showOrHideList: t1 show: false]

Code:

 makenewlist: t1 
    self createListNamed: t1

Code:

 deletenewlist: t1 
    self deleteList: t1

Code:

 makenewgloballist: t2 
    | t1 |
    (t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [^ self beep].
    t1 workPane createListNamed: t2.
    t1 viewerPane categoryChanged: 'variables'

Code:

deletenewgloballist: t1 
    | t2 |
    t2 _ self ownerThatIsA: ScratchStageMorph.
    lists removeKey: t1 asString ifAbsent: [].
    t2 submorphs do: [:t3 | ((t1 isKindOf: ScratchListMorph)
            and: [t3 listName = t1 and: [t1 target = self]])
            ifTrue: [t1 delete]]

they all work, exept the [delete global list []] is a little shakey (sometimes it works, sometimes it doesn't)


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

 

#988 2010-12-26 17:54:07

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

Re: Welcome to the OLD local block library!

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

 

#989 2010-12-26 20:02:57

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

Re: Welcome to the OLD local block library!

Pecola1 wrote:

I finally made the mouse cursor hide/show blocks!
First for the Show cursor:

Block spec:

('show mouse cursor' #- #showCursor)

and the code:

Code:

showCursor
    World activeHand showTemporaryCursor: nil

http://www.weebly.com/uploads/5/4/1/3/5413503/6052322.png

and now for the Hide Mouse Cursor.
Blockspecs:

('hide mouse cursor' #- #hideCursor)

Now for the code!

Code:

hideCursor
    World activeHand showTemporaryCursor: ((Form extent: 1 @ 1 depth: 32)
            fillColor: Color transparent)

http://www.weebly.com/uploads/5/4/1/3/5413503/6052322.png

Does this help?

Last edited by Pecola1 (2010-12-26 20:19:54)


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

 

#990 2010-12-26 20:16:29

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

Pecola1 wrote:

I finally made the mouse cursor hide/show blocks!
First for the Show cursor:

Block spec:

('show mouse cursor' #- #showCursor)

and the code:

Code:

showCursor
    World activeHand showTemporaryCursor: nil

http://www.weebly.com/uploads/5/4/1/3/5 … 052322.png

and now for the Hide Mouse Cursor.
Blockspecs:

('hide mouse cursor' #- #hideCursor)

Now for the code!

Code:

hideCursor
    World activeHand showTemporaryCursor: ((Form extent: 1 @ 1 depth: 32)
            fillColor: Color transparent)

http://www.weebly.com/uploads/5/4/1/3/5 … 052322.png

Are you still making those presentation blocks?
Enter presentation
exit presentation?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#991 2010-12-26 20:37:59

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

Re: Welcome to the OLD local block library!

ssss wrote:

Are you still making those presentation blocks?
Enter presentation
exit presentation?

I found out "the code" But I found out that It will only only work under... How the.... what the... I tried and tried before but it wouldn't work and now I try a simple version and it worked! Well the enter presentation mode did anyhow.

Picture:
http://www.weebly.com/uploads/5/4/1/3/5413503/8274608.gif?440

Blockspecs:

('enter presentation mode' #- #enterPresMode)

Instance:

Code:

enterPresMode
    | t1 |
    t1 _ self ownerThatIsA: ScratchFrameMorph.
    t1 enterPresentationMode

I am still trying for the exit presentation mode.

Last edited by Pecola1 (2010-12-26 20:39:58)


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

 

#992 2010-12-26 20:42:55

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

Re: Welcome to the OLD local block library!

http://www.weebly.com/uploads/5/4/1/3/5413503/6973459.gif?139

('Infinity' #r #inf)

Code:

inf
    ^ Float infinity

I got the idea from bingo but had no idea what the password was. So I decided to just try different codes. First i did:

Code:

 ^ 'Infinity'

But noticed it wouldn't work when doing, set a variable to 2
set it to itself squared ten times.
Or:
[blocks]
<set{ variable }to( 2
<repeat( 10
<set{ variable }to( (( <{ variable }> <*> <{ variable }> ))
<end>
[/blocks]
and then checking if the variable = infinity it said false.
so I let my Lil bro try and he said to remove the ''s otherwise he thought it would report 'infinity' instead of infinity.
That didn't help cuz it came with an error and I explained to him why.
I decided to look in the variable watcher place (forgot where now) the reason why is because when I showed the variable that set to infinity, it would say "infinity" but when I double clicked on it it would report "(insert thousand of numbers here which go off the screen)".
So I saw something without quotes that said "Float infinity" In the watcher place in the system browser.
I decided to try it and it worked!
(Thats the end of my extremely boring story that nobody cares about)

Last edited by Pecola1 (2010-12-26 20:59:51)


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

 

#993 2010-12-26 21:04:56

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

http://www.weebly.com/uploads/5/4/1/3/5 … 59.gif?139

('Infinity' #r #inf)

Code:

inf
    ^ Float infinity

I got the idea from bingo but had no idea what the password was. So I decided to just try different codes. First i did:

Code:

 ^ 'Infinity'

But noticed it wouldn't work when doing, set a variable to 2
set it to itself squared ten times.
Or:
[blocks]
<set{ variable }to( 2
<repeat( 10
<set{ variable }to( (( <{ variable }> <*> <{ variable }> ))
<end>
[/blocks]
and then checking if the variable = infinity it said false.
so I let my Lil bro try and he said to remove the ''s otherwise he thought it would report 'infinity' instead of infinity.
That didn't help cuz it came with an error and I explained to him why.
I decided to look in the variable watcher place (forgot where now) the reason why is because when I showed the variable that set to infinity, it would say "infinity" but when I double clicked on it it would report "(insert thousand of numbers here which go off the screen)".
So I saw something without quotes that said "Float infinity" In the watcher place in the system browser.
I decided to try it and it worked!
(Thats the end of my extremely boring story that nobody cares about)

Cool, useful block!


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#994 2010-12-26 21:08:39

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

Re: Welcome to the OLD local block library!

Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5413503/7131686.gif?366
I have been working for a long time on t but it wont work.
Heres the code:

Code:

getBooleanAttribute: t1 
    | t2 |
    (vars includesKey: t1)
        ifTrue: [^ vars at: t1].
    t2 _ t1 localized.
    'pen down?' localized = t2 ifTrue: [^ self t1 penDown].
    'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable].
    'is a clone?' localized = t2 ifTrue: [^ self t1 isClone].
    ^ false

it does not work yet.


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

 

#995 2010-12-26 21:09:40

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

Re: Welcome to the OLD local block library!

ssss wrote:

Pecola1 wrote:

http://www.weebly.com/uploads/5/4/1/3/5 … 59.gif?139

('Infinity' #r #inf)

Code:

inf
    ^ Float infinity

Cool, useful block!

Thanks


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

 

#996 2010-12-26 21:19:50

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on t but it wont work.
Heres the code:

Code:

getBooleanAttribute: t1 
    | t2 |
    (vars includesKey: t1)
        ifTrue: [^ vars at: t1].
    t2 _ t1 localized.
    'pen down?' localized = t2 ifTrue: [^ self t1 penDown].
    'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable].
    'is a clone?' localized = t2 ifTrue: [^ self t1 isClone].
    ^ false

it does not work yet.

you could try switching IfTrue and ^ False


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#997 2010-12-27 10:25:40

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on t but it wont work.
Heres the code:

Code:

getBooleanAttribute: t1 
    | t2 |
    (vars includesKey: t1)
        ifTrue: [^ vars at: t1].
    t2 _ t1 localized.
    'pen down?' localized = t2 ifTrue: [^ self t1 penDown].
    'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable].
    'is a clone?' localized = t2 ifTrue: [^ self t1 isClone].
    ^ false

it does not work yet.

Code:

getBooleanAttribute: t1 of: t2 
    | t3 t4 |
    t3 _ t1 localized.
    t4 _ self coerceSpriteArg: t2. "Finds the sprite with the name t2"
    'pen down?' localized = t3 ifTrue: [^ t4 penDown].
    'draggable?' localized = t3 ifTrue: [^ t4 draggable].
    'is a clone?' localized = t3 ifTrue: [^ t4 isClone].
    ^ false

The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#998 2010-12-27 14:34:18

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Welcome to the OLD local block library!

h flip and v flip - Scratch

these are 2 copies of the flip block, shared by pecola1, made by Jens (I think)

h flip
http://i.imgur.com/MCmJn.gif

goes under scriptable scratch morph

Code:

hflip
    costume form: (self form flipBy: #horizontal centerAt: 0 @ 0).
    self costumeChanged

blockspec
goes under scriptable sprite morph

Code:

('h flip' #- #hflip)

v flip
http://i.imgur.com/4w1mU.gif

goes under scriptable scratch morph

Code:

hflip
    costume form: (self form flipBy: #vertical centerAt: 0 @ 0).
    self costumeChanged

goes under scriptable scratch morph

Code:

('v flip' #- #vflip)

Last edited by owetre18 (2010-12-27 14:38:03)

Offline

 

#999 2010-12-27 16:12:22

kieru01
New Scratcher
Registered: 2010-12-06
Posts: 5

Re: Welcome to the OLD local block library!

thanks Pecola1 but I don't understand how write the blocspec and the code (i'm french and ih i understand english i'm not (yet) bilingual, that certainly the cause that prevent me to open the system browser . If you can explain me the procedure please. Thank you.

Offline

 

#1000 2010-12-27 17:32:48

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Opening the system browser in Scratch:

hold down the "Shift" (key with upward arrow on it by the ctrl key) key and then click in the hole in the "R" in the Scratch logo. A menu will open. Choose "Exit fullscreen". a white space will appear around the Scratch project. click on it and select "open" and then "browser" from the menu to open the green browser window.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

Board footer