scimonster wrote:
Greenatic wrote:
IMPORTANT NOTE: In the library post, Scimonster incorrectly stated the location of some code for my |make { v} draggable| and |make { v} undraggable| blocks. Scratch-Blocks > SpriteArgMorph > event handling > presentMenu is the correct location; he used "other" instead of "event handling".
Tomorrow.
Greenatic wrote:
joefarebrother wrote:
will someone do a byob update soon?
Or how about a full Scratch blocks update?
^^;
I'm not so good at BYOB updates, but I'll try if I can find them.
Byob takes the longest XD
Offline
(viewing mode) has now been fixed. See the original post on page 83 for the code.
Offline
improved case=sensitive BYOB
download link:http://www.megaupload.com/?d=MQSWDR3A
Last edited by roijac (2011-09-23 12:25:26)
Offline
roijac wrote:
improved case=sensitive BYOB
http://i.imgur.com/5RzfD.gif
download link:http://www.megaupload.com/?d=N8WPUGWC
That's neat!
Offline
scimonster wrote:
roijac wrote:
improved case=sensitive BYOB
http://i.imgur.com/5RzfD.gif
download link:http://www.megaupload.com/?d=N8WPUGWCThat's neat!
thanks!
Offline
i discovered a bug with the download block $Number$ from library block!
try to import block 0 61 or higher or nothing
and it will import a white bugged <html> block!
this is its code <link rel="shortcut icon" href="/static/images/favicon.ico"/>
Offline
Bklecka wrote:
i discovered a bug with the download block $Number$ from library block!
try to import block 0 61 or higher or nothing
and it will import a white bugged <html> block!
this is its code <link rel="shortcut icon" href="/static/images/favicon.ico"/>
Hmm. Seems like a bug.
Sparks, did you say you moved all the Panther blocks to the scratchr site?
Offline
Not successfully. The code wasn't imported AND the MySQL connection doesn't always work.
The glitch is because a block higher than that does not exist.
Last edited by sparks (2011-09-18 15:21:56)
Offline
More blocks! These allow you to mess with Scratch's logo! (temporarily) Please note: these blocks will (^ self) in presentation mode to avoid errors. Also, using an invalid file path will result in annoying menus and/or errors.
First of all, these all require a prerequisite method. Go to Scratch-UI-Panes > ScratchFrameMorph > accessing and create a new method:
logoMorph ^ logoMorph
('export logo as %s.bmp' #- #ExportBMP:) ExportBMP: t1 | t2 t3| t1 size = 0 ifTrue:[^ self]. (self ownerThatIsA: ScratchFrameMorph) ifNil:[^ self]. t3 _ t1. (t3 asLowercase endsWith: '.bmp') ifFalse: [t3 _ t3, '.bmp']. t2 _ (self ownerThatIsA: ScratchFrameMorph) logoMorph. ((t2 form) asFormOfDepth: 32) writeBMPFileNamed: t3
('export logo as %s.gif' #- #ExportGIF:) ExportGIF: t1 | t2 t3| t1 size = 0 ifTrue:[^ self]. (self ownerThatIsA: ScratchFrameMorph) ifNil: [^ self]. t3 _ t1. (t3 asLowercase endsWith: '.gif') ifFalse: [t3 _ t3, '.gif']. t2 _ (self ownerThatIsA: ScratchFrameMorph) logoMorph. GIFReadWriter putForm: ((t2 form) asFormOfDepth: 32) onFileNamed: t3
('export logo as %s.jpg, quality %n (1-100)' #- #ExportJPG:Quality:) ExportJPG: t1 Quality: t2 | t3 t4 t5 t6| (t2 < 1) | (t2 > 100) ifTrue:[^ self]. t1 size = 0 ifTrue:[^ self]. (self ownerThatIsA: ScratchFrameMorph) ifNil:[^self]. t4 _ t1. (t4 asLowercase endsWith: '.jpg') ifFalse: [t4 _ t4, '.jpg']. t3 _ (self ownerThatIsA: ScratchFrameMorph) logoMorph. t5 _ FastJPEG compress: ((t3 form) asFormOfDepth: 32) quality: t2 asNumber. t6 _ (FileStream newFileNamed: t1) binary. t6 nextPutAll: t5; close
('import logo from file %s' #- #ImportLogo: t1) ImportLogo: t1 t1 size = 0 ifTrue:[^ self]. ( t1 endsWith: '.jpg') | (t1 endsWith: '.jpeg') | (t1 endsWith: '.gif') | (t1 endsWith: '.bmp') | (t1 endsWith: '.png') ifFalse: [^ self]. (self ownerThatIsA: ScratchFrameMorph) ifNil:[^ self]. ((self ownerThatIsA: ScratchFrameMorph) logoMorph) form: (Form fromFileNamed: t1)
('repaint logo' #- #RepaintLogo) RepaintLogo (self ownerThatIsA: ScratchFrameMorph) ifNil:[^self]. ((self ownerThatIsA: ScratchFrameMorph) logoMorph) editDrawing
Last edited by Greenatic (2011-09-18 16:59:55)
Offline
What about PNG?
Offline
scimonster wrote:
What about PNG?
I made that one, then forgot to post it. Let me go remake it now...
EDIT: Actually, I didn't forget. Scratch has no method for exporting the logo as a PNG.
Last edited by Greenatic (2011-09-19 16:28:24)
Offline
More blocks!
('distance (%n,%n) (%n,%n)' #r #DistX:y:X:y:) DistX: t1 y: t2 X: t3 y: t4 (t1 @ t2) = (t3 @ t4) ifTrue:[^0]. ^ (((t1 - t3) * (t1 - t3)) + ((t2-t4)* (t2-t4))) sqrt
('slope (%n,%n) (%n,%n)' #r #SlopeX:y:X:y:) SlopeX: t1 y: t2 X: t3 y: t4 t1 = t3 ifTrue:[^ 'Undefined']. ^ (t2 - t4)/(t1-t3)
('midpoint x (%n,%n) (%n,%n)' #r #MidXX:y:X:y:) MidXX: t1 y: t2 X: t3 y: t4 t1 = t3 ifTrue:[^ t1]. ^ (t1+t3)/2
('midpoint y (%n,%n) (%n,%n)' #r #MidYX:y:X:y:) MidYX: t1 y: t2 X: t3 y: t4 (t2 = t4) ifTrue:[^ t2]. ^ (t2+t4)/2
Offline
Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;D
Offline
scimonster wrote:
Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;D
Distance: The distance between the two points.
Slope: The slope of the line intersecting the two points.
MidpointX: The x value of the point exactly between the two points.
MidpointY: The y value of the point exactly between the two points.
Offline
scimonster wrote:
Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;D
Sweet! NEW CHAMP? I don't even remember him/her being here before summer! LOL
Offline
Pecola1 wrote:
scimonster wrote:
Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;DSweet! NEW CHAMP? I don't even remember him/her being here before summer! LOL
I wasn't. (Him, by the way!)
Lol, looking back at the first block I made, the one w/ jslomba, I imagine how quickly I could have made that now...
BTW, were you just trying to get me to pause so you could catch up? No way that's happening! More blocks now!
('x:%n y: %n is within my bounds?' #b #WithinBoundsX:y:) WithinBoundsX: t1 y: t2 ^ (t1 <= (self xpos + (0.5 * self width))) & (t1 >= (self xpos - (0.5 * self width))) & (t2 <= (self ypos + (0.5 * self height))) & (t2 >= (self ypos - (0.5 * self height)))
NOTE: The following two blocks require an alteration to the presentMenu method. See the |make { v} draggable| and |make { v} undraggable| for instructions, but remember to use the methods of these blocks.
('%m center is within my bounds?' #b #CentWithin:) CentWithin: t1 ^ ((t1 xpos) <= (self xpos + (0.5 * self width))) & (((t1 xpos) >= (self xpos - (0.5 * self width))) & ((t1 ypos) <= (self ypos + (0.5 * self height))) & ((t1 ypos) >= (self ypos - (0.5 * self height))))
('%m is completely within my bounds?' #b #CompWithin:) CompWithin: t1 ^ t1 xpos + (0.5 * t1 width) <= (self xpos + (0.5 * self width)) & (t1 xpos - (0.5 * t1 width) >= (self xpos - (0.5 * self width))) & (t1 ypos + (0.5 * t1 height) <= (self ypos + (0.5 * self height))) & (t1 ypos - (0.5 * t1 height) >= (self ypos - (0.5 * self height)))
Last edited by Greenatic (2011-09-20 21:10:54)
Offline
Another good collection of blocks there, Greenatic!
Can I just remind you all that whilst the title of top block contributor is something worth working towards, make sure that your blocks are actually useful rather than trying to gain the title by making every method you can find into a block!
Offline
I'm pretty sure almost all of Greenatic's blocks are useful.
Offline
sparks wrote:
Can I just remind you all that whilst the title of top block contributor is something worth working towards, make sure that your blocks are actually useful rather than trying to gain the title by making every method you can find into a block!
I'm not just doing that! (Honestly, I'm a little offended...)
scimonster wrote:
I'm pretty sure almost all of Greenatic's blocks are useful.
Thanks! By the way, has anyone made a |save image for end-user| block? I would check but my computer freezes for five minutes if I so much as look at the Block Library page 1.
Offline
Greenatic wrote:
By the way, has anyone made a |save image for end-user| block? I would check but my computer freezes for five minutes if I so much as look at the Block Library page 1.
I have.
Offline
Weebly is blocked by Scratch right now, but I asked for an exception for us.
Also, I wrote something on the wiki page. Does anyone think it should go in post #41? :3
Offline
Right, I especially said that your blocks were very good to imply that you weren't creating simple blocks, Greenatic! I Agree they're fantastic! I was just sort of mentioning it to the general community
Offline
sparks wrote:
Right, I especially said that your blocks were very good to imply that you weren't creating simple blocks, Greenatic! I Agree they're fantastic! I was just sort of mentioning it to the general community
Oops. I apologize for not reading the whole post, and for mistaking it for an implied insult.
scimonster wrote:
Greenatic wrote:
By the way, has anyone made a |save image for end-user| block? I would check but my computer freezes for five minutes if I so much as look at the Block Library page 1.
I have.
Did you share it?
I believe this is my 400th post.
Last edited by Greenatic (2011-09-21 17:17:07)
Offline
NOTE: These blocks intentionally will always return false in presentation mode, to avoid errors.
('image %s exists anywhere?' #b #ImgAnywhere:) ImgAnywhere: t1 (self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false]. (((self ownerThatIsA: ScratchFrameMorph) allProjectMedia) select: [:t2| (t2 asString) = (t1, ' [image]')]) ~= (#() asOrderedCollection)
('sound %s exists anywhere?' #b #SndAnywhere:) SndAnywhere: t1 (self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false]. (((self ownerThatIsA: ScratchFrameMorph) allProjectMedia) select: [:t2| (t2 asString) = (t1, ' [sound]')]) ~= (#() asOrderedCollection)
('media item %s exists anywhere?' #b #MedAnywhere:) MedAnywhere: t1 (self ownerThatIsA: ScratchFrameMorph) ifNil:[^ false]. (((self ownerThatIsA: ScratchFrameMorph) allProjectMedia) select: [:t2| ((t2 asString) = (t1, ' [sound]')) | ((t2 asString) = (t1, ' [image]'))]) ~= (#() asOrderedCollection)
Offline
Greenatic wrote:
Pecola1 wrote:
scimonster wrote:
Could you provide explanations?
And when I do that update, we'll have to crown Greenatic as the new Scratch Blocks champ. ;DSweet! NEW CHAMP? I don't even remember him/her being here before summer! LOL
I wasn't. (Him, by the way!)
Lol, looking back at the first block I made, the one w/ jslomba, I imagine how quickly I could have made that now...
BTW, were you just trying to get me to pause so you could catch up? No way that's happening! More blocks now!
Nah, XD I cant even remember the last time I made a block XD I haven't made one since i became a Librarian! LOL XD It seems weird cuz I've been trying some more advanced blocks like a working bounce block and other things like that, I keep thinking I have it but it always ends up it coincidentally worked XD.
Offline