randalpik wrote:
I can't figure out how to make the Graphic effect reporter block... can someone help?
Here it is just quickly. i've got hw to do now!
getEffect: t1 filterPack ifNil: [^ 0]. 'blur' = t1 ifTrue: [^ filterPack blur]. 'brightness' = t1 ifTrue: [^ filterPack brightnessShift]. 'fisheye' = t1 ifTrue: [^ filterPack fisheye]. 'color' = t1 ifTrue: [^ filterPack hueShift]. 'colour' = t1 ifTrue: [^ filterPack hueShift]. 'mosaic' = t1 ifTrue: [^ filterPack mosaicCount]. 'pixelate' = t1 ifTrue: [^ filterPack pixelateCount]. 'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize]. 'saturation' = t1 ifTrue: [^ filterPack saturationShift]. 'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency]. 'whirl' = t1 ifTrue: [^ filterPack whirl]
Hope it helps.
Offline
Can you make a show/hide timer block? It should be simple... I am only a beginner at hacking scratch so I might not be able to make it (right now I am looking at the "stuff" of the show/hide variable/list block
Offline
Just set a variable to the timer and use the hide/show variable blocks.
Offline
LS97 wrote:
randalpik wrote:
I can't figure out how to make the Graphic effect reporter block... can someone help?
Here it is just quickly. i've got hw to do now!
Code:
getEffect: t1 filterPack ifNil: [^ 0]. 'blur' = t1 ifTrue: [^ filterPack blur]. 'brightness' = t1 ifTrue: [^ filterPack brightnessShift]. 'fisheye' = t1 ifTrue: [^ filterPack fisheye]. 'color' = t1 ifTrue: [^ filterPack hueShift]. 'colour' = t1 ifTrue: [^ filterPack hueShift]. 'mosaic' = t1 ifTrue: [^ filterPack mosaicCount]. 'pixelate' = t1 ifTrue: [^ filterPack pixelateCount]. 'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize]. 'saturation' = t1 ifTrue: [^ filterPack saturationShift]. 'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency]. 'whirl' = t1 ifTrue: [^ filterPack whirl]Hope it helps.
Thanks! I now have 18 hacked blocks
Offline
I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:
cloneWithName: t1 | frame stage clone | (frame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self]. frame _ frame frame]. stage _ frame workPane. clone _ ScriptableScratchMorph duplicateNoAttach. clone objName: self objName , '(t1)'. stage addMorphFront: t1
Offline
Billybob-Mario wrote:
I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:
Code:
cloneWithName: t1 | frame stage clone | (frame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self]. frame _ frame frame]. stage _ frame workPane. clone _ ScriptableScratchMorph duplicateNoAttach. clone objName: self objName , '(t1)'. stage addMorphFront: t1
Is the instance in ScriptableScratchMorph?
Offline
Billybob-Mario wrote:
I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:
Hmm... that doesnt work for me either, but i can't really help you because Scratch just felt like not running that block anymore and no matter what i do it's not running. i hate it when it's so stubborn :p
Offline
I'm trying to make a clone with name block. It doesn't work. Can anyone help? Here is my code.
cloneWithName: t1 | frame stage clone | (frame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self]. frame _ frame frame]. stage _ frame workPane. clone _ ScriptableScratchMorph duplicateNoAttach. clone objName: self objName , '(t1)'. stage addMorphFront: t1 clone eventReceived: 'Created'.
Offline
Nice!
Offline
LS97 wrote:
There's many more types of hat blocks, but i won't include them all.
Actually there's only one more.
#E the "when I receive" hat block
Offline
I'm making a tutorial project which goes into the different elements of the source code in more detail. I'll tell you when it's out.
P.S. where's 14 in your signature?
Last edited by randalpik (2010-04-25 20:33:14)
Offline
randalpik wrote:
I'm making a tutorial project which goes into the different elements of the source code in more detail. I'll tell you when it's out.
It would be very helpful to include it in this tutorial as a link! please tell me when you're done, thanks!
Last edited by LS97 (2010-04-26 11:53:23)
Offline
please, experienced Squeak-ers, how do you handle a 'down key pressed' event for non-block related stuff, like the scolling bars? (hint hint: i'm working on Bingo and trying to make a different scrolling method)
Offline
Hmm - I'm looking at the list in the first post, and the only blocks which I think could be made in BYOB are lowercased (and probably uppercased) and reversed blocks...
Either way, awesome guide!
Last edited by Lucario621 (2010-04-26 15:42:44)
Offline
nXIII wrote:
Cloning blocks:
(yay, I made these)
Somewhat simplified because you don't have to send it an event, like Panther.cloneMe
| frame stage clone |
(frame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self] ifNotNil: [frame _ frame frame]].
stage _ frame workPane.
clone _ self fullCopy.
clone objName: (self objName), ' clone'.
stage addMorphFront: clone.If you want to send it a broadcast message, add the line
clone eventReceived: 'Created'.
to the end and if the sprite has a 'when I receive [Created]' that will start (in the clone) when it is cloned.
It might not work, I did that off of memory, not copy-paste. (This isn't my computer)
it worked for me...but it isn't very useful because it just acts as a movable stamp. i could drag it manually, but i couldn't control the clone with move ten steps or whatever. it also doesn't go to (0,0).
p.s pretty impressive you can do that off the top of your head.
Offline
I cant make the blocks, i go to my broser then go through all the steps, but were do i paste the code?
Offline
Can you post tutorials for [] reversed and [] uppercase please? Thanks.
Offline
How do you make a (report __) block?
Offline
rocket101 wrote:
How do you make a (report __) block?
why would you want to make that?
Offline