I really need a way for a costume to have all of one colour cleared to show transparent background. If anyone has the block code it would be very helpful and save me a lot of time doing it by hand!
Last edited by sparks (2012-01-18 12:47:42)
Offline
Maybe you could look in the coding of the paint editor (Scratch-Paint)? It may be there...
Offline
I'm working on one; I almost have it. Just a few minutes...

Offline
sparks wrote:
Greenatic wrote:
I'm working on one; I almost have it. Just a few minutes...
Awesome! I can't wait to see it!
I've got it replacing, but I can't figure out how to update the thumbnails...
...or the image on the Scratch window itself...but the form is updated.
Last edited by Greenatic (2012-01-20 18:27:31)

Offline
bummer... have you tried
stage changed.
? I've also seen:
viewerPane categoryChanged: 'variables'
which may be changeable or close to what you're looking for. I think it's about refreshing the right section.
Offline
sparks wrote:
bummer... have you tried
stage changed.
? I've also seen:
viewerPane categoryChanged: 'variables'
which may be changeable or close to what you're looking for. I think it's about refreshing the right section.
Never mind, I seem to have found it. Please let me know of any glitches (and include this in the Block Library Panther update when you get a chance). Please note: Colored text is not effected.
Stack block; Looks
clear color $Color$ from $Costumes$
| t3 t4 | [media detect:[:t5| t5 asString = (t2, ' [image]')]] ifError:[^self]. t3 _ media detect:[:t5| t5 asString = (t2, ' [image]')]. [ (t3 form) replaceColor: t1 with: (Color transparent)] ifError:[^self]. (t3 form) replaceColor: t1 with: (Color transparent). self changed. (self ownerThatIsA: ScratchFrameMorph) ifNil: [^ self]. (((self ownerThatIsA: ScratchFrameMorph) findA: ScratchScriptEditorMorph) findA: ScratchThumbnailMorph) updateThumbnail. (((self ownerThatIsA: ScratchFrameMorph) findA: ScratchScriptEditorMorph) findA: ScratchTabPaneMorph) ifNil:[^ self]. t4 _ (((self ownerThatIsA: ScratchFrameMorph) findA: ScratchScriptEditorMorph) findA: ScratchTabPaneMorph) currentTab. (((self ownerThatIsA: ScratchFrameMorph) findA: ScratchScriptEditorMorph) findA: ScratchTabPaneMorph) currentTab: 'Costumes'. (((self ownerThatIsA: ScratchFrameMorph) findA: ScratchScriptEditorMorph) findA: ScratchTabPaneMorph) currentTab: t4.
Last edited by Greenatic (2012-01-20 19:12:38)

Offline
Incredible! I love it!!!! Thanks very much, it's amazing what is possible with the custom blocks
I'll try and do a Panther update sometime soon, I know I've been neglecting it but I have so much other work!
Offline
Glad you like it!

Offline
sparks wrote:
strangely this doesn't seem to work anymore...
OK, that's odd...could a more experienced Squeaker help us out here?

Offline
Odd. It seems to be updating the actual costume atm whilst the icons in the sprite info bit and the sprites list bit as well as the actual sprite on the stage don't change until you [edit] the costume.
Offline
Another thing I've just noticed is that if you use the colour replace on the default Panther costume, it will stay like that until you close the window, creating a new project won't get rid of the changes!
Offline
sparks wrote:
Odd. It seems to be updating the actual costume atm whilst the icons in the sprite info bit and the sprites list bit as well as the actual sprite on the stage don't change until you [edit] the costume.
That's what I spent so long trying to figure out how to fix. Great.
sparks wrote:
Another thing I've just noticed is that if you use the colour replace on the default Panther costume, it will stay like that until you close the window, creating a new project won't get rid of the changes!
Maybe it's got a problem with transparency? I don't know...

Offline
sparks wrote:
Well the images I was trying to manipulate were stage shots with no transparency... its really confusing though, swear it worked fine before.
This seems to work as well on the current costume, but creates a new costume and messes with the size on the Scratch cat:
(self form) mapColor: t1 to: Color transparent.
self form: ((self form) copy: ((self form) rectangleEnclosingPixelsNotOfColor: Color transparent))Last edited by Greenatic (2012-02-07 17:58:09)

Offline