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
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":
in the box, type "download block $Number$ from block library" and click OK:
In the new box, copy this code and paste it in to the big box:
|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:
Click OK.
At the bottom of the variable tab, you now have a 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 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!
Last edited by sparks (2010-12-26 11:41:32)
Offline
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.
Offline
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.
Offline
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.
Offline
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: nilWhat 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
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!
Offline
sparks wrote:
hello12345678910, your submitted block has already been shared! Sorry!
is it in the scratch blocks? because i don't see it...
Offline
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"
Offline
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:
('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)
showList: t1 | t2 | self showOrHideList: t1 show: true. t2 _ self ownerThatIsA: ScratchStageMorph. t2 ~= self ifTrue: [t2 showOrHideList: t1 show: true]
hideList: t1 | t2 | self showOrHideList: t1 show: false. t2 _ self ownerThatIsA: ScratchStageMorph. t2 ~= self ifTrue: [t2 showOrHideList: t1 show: false]
makenewlist: t1 self createListNamed: t1
deletenewlist: t1 self deleteList: t1
makenewgloballist: t2 | t1 | (t1 _ self ownerThatIsA: ScratchFrameMorph) ifNil: [^ self beep]. t1 workPane createListNamed: t2. t1 viewerPane categoryChanged: 'variables'
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)
Offline
Bump
Offline
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
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)
Does this help?
Last edited by Pecola1 (2010-12-26 20:19:54)
Offline
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: nilhttp://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)
Are you still making those presentation blocks?
Enter presentation
exit presentation?
Offline
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:
Blockspecs:
('enter presentation mode' #- #enterPresMode)
Instance:
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)
Offline
('Infinity' #r #inf)
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:
^ '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)
Offline
Pecola1 wrote:
http://www.weebly.com/uploads/5/4/1/3/5 … 59.gif?139
('Infinity' #r #inf)
Code:
inf ^ Float infinityI 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!
Offline
Can someone help me with this?
I have been working for a long time on t but it wont work.
Heres the 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.
Offline
ssss wrote:
Pecola1 wrote:
http://www.weebly.com/uploads/5/4/1/3/5 … 59.gif?139
('Infinity' #r #inf)
Code:
inf ^ Float infinityCool, useful block!
Thanks
Offline
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]. ^ falseit does not work yet.
you could try switching IfTrue and ^ False
Offline
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]. ^ falseit does not work yet.
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
Offline
h flip and v flip - Scratch
these are 2 copies of the flip block, shared by pecola1, made by Jens (I think)
h flip
goes under scriptable scratch morph
hflip costume form: (self form flipBy: #horizontal centerAt: 0 @ 0). self costumeChanged
blockspec
goes under scriptable sprite morph
('h flip' #- #hflip)
v flip
goes under scriptable scratch morph
hflip costume form: (self form flipBy: #vertical centerAt: 0 @ 0). self costumeChanged
goes under scriptable scratch morph
('v flip' #- #vflip)
Last edited by owetre18 (2010-12-27 14:38:03)
Offline
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
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.
Offline