This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-14 08:25:45

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

How do you make blocks have different colours from other blocks...

... in the same category? As an example, list blocks are in the variables category but are different colours from variable blocks.

Please answer, I want some 3D blocks in my still-under development modification to be different from the rest of the Motion blocks.

Or how do you use the ScratchSkin?

And where did the tutorials all go?

Last edited by rdococ (2012-02-14 08:39:33)

Offline

 

#2 2012-02-14 08:34:16

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Offline

 

#3 2012-02-14 08:40:17

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

Err, there's no "easy way out". I'll look into it, though.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5 2012-02-14 09:40:28

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

I can't find it, but you basically need to edit the stuff under scratch-objects > scriptablescratchmorph (class) > blockspecs > [color methods]

Last edited by Hardmath123 (2012-02-14 09:45:06)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6 2012-02-14 09:47:44

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

I added the new colour to BlockColorsFor:, now how do I actually apply the change to the block?

Current code
t1 = 'space' ifTrue: [^ Color
     h: 0
     s: 0
     v: 0.23].

Last edited by rdococ (2012-02-14 09:47:59)

Offline

 

#7 2012-02-14 10:00:41

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

rdococ wrote:

I added the new colour to BlockColorsFor:, now how do I actually apply the change to the block?

Current code
t1 = 'space' ifTrue: [^ Color
     h: 0
     s: 0
     v: 0.23].

You also have the blockspec under a new category called 'space', right?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#8 2012-02-14 10:05:29

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

Hardmath123 wrote:

rdococ wrote:

I added the new colour to BlockColorsFor:, now how do I actually apply the change to the block?

Current code
t1 = 'space' ifTrue: [^ Color
     h: 0
     s: 0
     v: 0.23].

You also have the blockspec under a new category called 'space', right?

No--- I'll add that right now.

Doesn't work, it just removes the blocks from sight-- and I also made a global variable called 'SpaceBlockColor' instead to replace the actual color data (in order to make it as close as possible to 'ListBlockColor').

Last edited by rdococ (2012-02-14 10:07:12)

Offline

 

#9 2012-02-14 14:43:02

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

rdococ wrote:

Hardmath123 wrote:

rdococ wrote:

I added the new colour to BlockColorsFor:, now how do I actually apply the change to the block?

Current code
t1 = 'space' ifTrue: [^ Color
     h: 0
     s: 0
     v: 0.23].

You also have the blockspec under a new category called 'space', right?

No--- I'll add that right now.

Doesn't work, it just removes the blocks from sight-- and I also made a global variable called 'SpaceBlockColor' instead to replace the actual color data (in order to make it as close as possible to 'ListBlockColor').

You have to override the behavior in the main block-page-creating method in ScriptableScratchMorph's blocks category. Look at variablesPage for an idea of how to do this.


nXIII

Offline

 

#10 2012-02-15 08:20:47

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: How do you make blocks have different colours from other blocks...

nXIII wrote:

rdococ wrote:

Hardmath123 wrote:

You also have the blockspec under a new category called 'space', right?

No--- I'll add that right now.

Doesn't work, it just removes the blocks from sight-- and I also made a global variable called 'SpaceBlockColor' instead to replace the actual color data (in order to make it as close as possible to 'ListBlockColor').

You have to override the behavior in the main block-page-creating method in ScriptableScratchMorph's blocks category. Look at variablesPage for an idea of how to do this.

Where is it?

Oh, found it.

Can you give me an example code with 'space', no making or deleting buttons, just differently coloured blocks?

Oh, found it again. Do I make a category called space ops?

Wait--- this is too hard for me.

Last edited by rdococ (2012-02-15 08:45:50)

Offline

 

Board footer