randalpik wrote:
LS97 wrote:
2) ask nXIII. i'm also interested in this.
He says that we're all doing it wrong and blah blah blah and instead of deleting the rebuildCategorySelectors we should have added to it and blah blah blah. In conclusion, I will try to figure it out myself.
Um... OK then.
LS97 wrote:
hmm... nXIII, i know you're a great Squeaker and i love your show/hide list blocks, but why come onto this thread if you don't like the solutions i find? i'm not trying to make you go away, just saying that you're a bit too... know-it-all. "LS97 did this wrong, that wrong, do this, do that, do it my way it's the good way..."
anyway. where are the images stored?
by the way, i'm a he
I'm just trying to improve everyone's knowledge of Squeak and help you do things permanently. For example, if you crashed the Scratch frame while trying out a new block and then you deleted it to get rid of errors, when you create it again it won't have the buttons, and worse, it probably won't even work because you deleted a message that 'initialize' sends to its receiver.
Last edited by nXIII (2010-05-02 11:44:18)
Offline
nXIII wrote:
I'm just trying to improve everyone's knowledge of Squeak and help you do things permanently. For example, if you crashed the Scratch frame while trying out a new block and then you deleted it to get rid of errors, when you create it again it won't have the buttons, and worse, it probably won't even work because you deleted a message that 'initialize' sends to its receiver.
hmm... it's true that some blocks i have in Scratch that are in squeak don't work because of "findTokens:". what's that? and if you're so knowledgeable, could you add two categories to the rebuildSelectors called 'world' (in green) and 'files' (cyan) and post the code please? i'm desperate to make it work, even if it won't look as nice as i made it by dragging everything around :p
Offline
LS97 wrote:
The key_pressed reporter block
a great block that saves you the fuss of making 30 scripts for each different key. just add this to a forever if and youre done with your scripting for a text program! add the block wherever you want, and add this code into the corresponding instance ops.Code:
(Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'Pretty long eh? don't be discouraged it's worth it!
could you please make a blockspec for it? I don't know if it's ('key %s pressed' #b #code) or ('key pressed' #b #code), or if it's something else. I know you already did this but IDK if it's a reporter or a booolean or if it is suppored to have a string or not. Im just sortof confused
Last edited by Joeman592 (2010-05-02 18:15:22)
Offline
Joeman592 wrote:
roger- wrote:
here's a good exponent block. put it under operators.
Code:
exp: t1 raisedTo: t2 | t3 | t3 _ t1 raisedTo: t2. ^ t3But there isn't an operators... and if there is PLEASE TELL ME CUZ I CANT FIND IT! please? Also, please tell me if it goes in string.
Operators is the new name for numbers in 1.4
Offline
Joeman592 wrote:
LS97 wrote:
The key_pressed reporter block
a great block that saves you the fuss of making 30 scripts for each different key. just add this to a forever if and youre done with your scripting for a text program! add the block wherever you want, and add this code into the corresponding instance ops.Code:
(Sensor keyPressed: 65) ifTrue: [^ 'a']. (Sensor keyPressed: 66) ifTrue: [^ 'b']. (Sensor keyPressed: 67) ifTrue: [^ 'c']. (Sensor keyPressed: 68) ifTrue: [^ 'd']. (Sensor keyPressed: 69) ifTrue: [^ 'e']. (Sensor keyPressed: 70) ifTrue: [^ 'f']. (Sensor keyPressed: 71) ifTrue: [^ 'g']. (Sensor keyPressed: 72) ifTrue: [^ 'h']. (Sensor keyPressed: 73) ifTrue: [^ 'i']. (Sensor keyPressed: 74) ifTrue: [^ 'j']. (Sensor keyPressed: 75) ifTrue: [^ 'k']. (Sensor keyPressed: 76) ifTrue: [^ 'l']. (Sensor keyPressed: 77) ifTrue: [^ 'm']. (Sensor keyPressed: 78) ifTrue: [^ 'n']. (Sensor keyPressed: 79) ifTrue: [^ 'o']. (Sensor keyPressed: 80) ifTrue: [^ 'p']. (Sensor keyPressed: 81) ifTrue: [^ 'q']. (Sensor keyPressed: 82) ifTrue: [^ 'r']. (Sensor keyPressed: 83) ifTrue: [^ 's']. (Sensor keyPressed: 84) ifTrue: [^ 't']. (Sensor keyPressed: 85) ifTrue: [^ 'u']. (Sensor keyPressed: 86) ifTrue: [^ 'v']. (Sensor keyPressed: 87) ifTrue: [^ 'w']. (Sensor keyPressed: 88) ifTrue: [^ 'x']. (Sensor keyPressed: 89) ifTrue: [^ 'y']. (Sensor keyPressed: 90) ifTrue: [^ 'z']. (Sensor keyPressed: 32) ifTrue: [^ 'space']. (Sensor keyPressed: 1) ifTrue: [^ 'home']. (Sensor keyPressed: 4) ifTrue: [^ 'end']. (Sensor keyPressed: 5) ifTrue: [^ 'insert']. (Sensor keyPressed: 9) ifTrue: [^ 'tab']. (Sensor keyPressed: 11) ifTrue: [^ 'page up']. (Sensor keyPressed: 12) ifTrue: [^ 'page down']. (Sensor keyPressed: 127) ifTrue: [^ 'delete']. ^ 'none'Pretty long eh? don't be discouraged it's worth it!
could you please make a blockspec for it? I don't know if it's ('key %s pressed' #b #code) or ('key pressed' #b #code), or if it's something else. I know you already did this but IDK if it's a reporter or a booolean or if it is suppored to have a string or not. Im just sortof confused
Use ('get key' #r #code)
Offline
Can you make a: if I receive ______ block?
Offline
Joeman592 wrote:
could you please help me with one little thing please? a (pen color) reporter block and a color picker reporter? please? it would be a HUGE help
you do know that there are 225³ colors (approx 11 400 000) possible, don't you? that's why i can't make a color reporter that fits on one line. i can make the pen color one: ('pen hue' #r #penColor) should do the trick.
Last edited by LS97 (2010-05-03 11:59:08)
Offline
LS97 wrote:
Joeman592 wrote:
could you please help me with one little thing please? a (pen color) reporter block and a color picker reporter? please? it would be a HUGE help
you do know that there are 225³ colors (approx 11 400 000) possible, don't you? that's why i can't make a color reporter that fits on one line. i can make the pen color one: ('pen hue' #r #penColor) should do the trick.
Well, you could use the Panther method:
Offline
LS97 wrote:
Joeman592 wrote:
could you please help me with one little thing please? a (pen color) reporter block and a color picker reporter? please? it would be a HUGE help
you do know that there are 225³ colors (approx 11 400 000) possible, don't you? that's why i can't make a color reporter that fits on one line. i can make the pen color one: ('pen hue' #r #penColor) should do the trick.
11,400,000 is only 8 digits. It should fit in a variable.
Offline
I found the answer to our coloring problem! Just make all the buttons the same color!!! lol
EDIT: I feel like killing myself now. I've messed up the scratch viewer morph and I *saved* the image accidentally. DYE SELF NAO -----|- (that's a sword)
Last edited by randalpik (2010-05-03 21:46:42)
Offline
nXIII wrote:
Sparkyasa wrote:
nXIII wrote:
um... asciiFor:What's the Squeak code for it? And where should I put the code?
That's an already-existing message, if you don't want it to recognize things like 'space' then you have to make a new message
__________________________________________randalpik wrote:
I got it a lot farther than before, but I have three questions:
1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.
2) how do you change the color of the button itself?
3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.
All right, so I crashed my version of Scratch and had to start over. I'm following your instructions. But I couldn't find the message on how to reload the skin- can you help?
Offline
randalpik wrote:
LS97 wrote:
Joeman592 wrote:
could you please help me with one little thing please? a (pen color) reporter block and a color picker reporter? please? it would be a HUGE help
you do know that there are 225³ colors (approx 11 400 000) possible, don't you? that's why i can't make a color reporter that fits on one line. i can make the pen color one: ('pen hue' #r #penColor) should do the trick.
11,400,000 is only 8 digits. It should fit in a variable.
I tried it, and it reports nil when it is clicked 3:
Last edited by Joeman592 (2010-05-03 22:56:08)
Offline
Joeman592 wrote:
I tried it, and it reports nil when it is clicked 3:
hm.. it should report 'Color blue'.... wierd.
Offline
nXIII wrote:
Well, you could use the Panther method:
wow! that's a great method! but i'm just wondering, there's no existing block 'format' for it, i guess you had to create one. that's too much for me i guess i'll never be able to get even half as far as you guys have with Panther, you're so awesome! when's panther coming out (i know it's coming soon, no need to tell me THAT)
Offline
LS97 wrote:
nXIII wrote:
Well, you could use the Panther method:
wow! that's a great method! but i'm just wondering, there's no existing block 'format' for it, i guess you had to create one. that's too much for me i guess i'll never be able to get even half as far as you guys have with Panther, you're so awesome! when's panther coming out (i know it's coming soon, no need to tell me THAT)
Hm... well, the release is being held up by a few things:
1) Moveable pen trails (stage has blocks for this)
2) Camera blocks
3) Other stuff I can't remember...
You're right that I had to make a new block class for the color reporters.
Offline
nXIII wrote:
randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.
How do you reload the skin?
Offline
TheSuccessor wrote:
Joeman592 wrote:
roger- wrote:
here's a good exponent block. put it under operators.
Code:
exp: t1 raisedTo: t2 | t3 | t3 _ t1 raisedTo: t2. ^ t3But there isn't an operators... and if there is PLEASE TELL ME CUZ I CANT FIND IT! please? Also, please tell me if it goes in string.
Operators is the new name for numbers in 1.4
yeah i meant in the source code
Offline
Joeman592 wrote:
TheSuccessor wrote:
Joeman592 wrote:
But there isn't an operators... and if there is PLEASE TELL ME CUZ I CANT FIND IT! please? Also, please tell me if it goes in string.Operators is the new name for numbers in 1.4
yeah i meant in the source code
It's under ScratchSpriteMorph
Offline
nXIII wrote:
Sparkyasa wrote:
nXIII wrote:
um... asciiFor:
What's the Squeak code for it? And where should I put the code?
That's an already-existing message, if you don't want it to recognize things like 'space' then you have to make a new message
__________________________________________randalpik wrote:
I got it a lot farther than before, but I have three questions:
1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.
2) how do you change the color of the button itself?
3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.
Oops... Oh, that was bad... I just did this, and it's nice, my skin loaded except the extra block categories I made, but that's besides the point. I did it and, when I switch to the costumes/sounds tab in a sprite/stage, I get a squeak error. I'll edit the post with the error soon, I have to go soon. Please help, I had a lot of important stuff on my image file, and I saved it for end user. Thanks.
EDIT: The error is 'key not found'.
Another EDIT: Never mind, I fixed it (phew!) by loading in the normal skin.
Last edited by Zorbak42 (2010-05-05 06:53:54)
Offline
randalpik wrote:
Joeman592 wrote:
TheSuccessor wrote:
Operators is the new name for numbers in 1.4yeah i meant in the source code
It's under ScratchSpriteMorph
could you please give me thge steps of where to put it, and the blockspec, cuz it won't work
Offline
Joeman592 wrote:
randalpik wrote:
Joeman592 wrote:
yeah i meant in the source codeIt's under ScratchSpriteMorph
could you please give me thge steps of where to put it, and the blockspec, cuz it won't work
Instead of scriptablescratchmorph, go to scratch sprite morph, to block specs, and to blockSpecs. and then go into instance and then to string ops
Offline
LS97 wrote:
The http://www.freeimagehosting.net/uploads/db8cb97ba8.gifblock
Another request of SeptimusHeap.
Put this code in both Sprite and Stage Morph blockSpecs in the sensing category:Code:
('%s mouse down?' #b #mousePressed: 'left')then into the instance, into ScriptableScratchMorph, and into 'sensing ops'.
replace the 'mousePressed' code with the one below.Code:
mousePressed: t1 t1 = 'left' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any' ifTrue: [^ Sensor anyButtonPressed]. t1 = 'left ' ifTrue: [^ Sensor redButtonPressed]. t1 = 'right ' ifTrue: [^ Sensor yellowButtonPressed]. t1 = 'middle ' ifTrue: [^ Sensor blueButtonPressed]. t1 = 'any ' ifTrue: [^ Sensor anyButtonPressed]. ^ Sensor redButtonPressedThen click accept and it should be fine. you'll find the new block in the sensing category. you can put left, right, middle or any into the box and it'll give you the respective sensor button boolean.
Doesn't work
Offline