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

#1 2012-09-05 09:48:01

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

How to change color of Scratch Font

I guess someone already asked this question somewhere in the forum, but I couldn't find it.

Could someone let me know all places in Scratch.image where I have to change something so that the color of the labels of Scratch blocks/categories will  be black instead of white? I changed in "Blockmorph class initialize", but the labels are still white...

As a more general question (if you answer the first one  smile  ) could you please detail which steps did you follow in Squeak to find all the relevant portions of Squeak code that affect labels' color? Thanks in advance!!!

Offline

 

#2 2012-09-05 11:36:50

Joewheeeeler
Scratcher
Registered: 2012-05-17
Posts: 40

Re: How to change color of Scratch Font

Sorry I can't really help you, But I Do know basic Color Codes... Such as, [/color=blue] Makes the Color Blue (No Forward slash) It Produces this Blue and that [/color] makes the color disappear again... I Also know that You can produce Red by doing this [/color=#FF0000] (Again No Slash for it to work) and that produces this Red and then you will need [/color] to close it off again but that is really all... Try putting those codes before and after the Scratchblocks... Good Luck anyway, You can find out more and some other useful information here  wink


http://i.imgur.com/CxwNg.gif

Offline

 

#3 2012-09-05 15:15:08

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: How to change color of Scratch Font

Joewheeeeler wrote:

Sorry I can't really help you, But I Do know basic Color Codes... Such as, [/color=blue] Makes the Color Blue (No Forward slash) It Produces this Blue and that [/color] makes the color disappear again... I Also know that You can produce Red by doing this [/color=#FF0000] (Again No Slash for it to work) and that produces this Red and then you will need [/color] to close it off again but that is really all... Try putting those codes before and after the Scratchblocks... Good Luck anyway, You can find out more and some other useful information here  wink

S/He wants help in Squeak (what Scratch is written in), not BBCode. To the question, absolutely no idea.


Who would win, SOPA or PIPA?

Offline

 

#4 2012-09-05 15:38:35

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: How to change color of Scratch Font

fill-screen off; right-click repeatedly on the button tells me it's a ResizeableToggleButton2; click the spanner icon, "browse morph class"; looks like it's set at the end of the initialise method (I think?)

Hope that helps; I'm no expert Squeaker  tongue

I'm on a Mac; I don't know if right-clicking works on other platforms. Perhaps a modifier key such as alt?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#5 2012-09-06 05:14:20

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

I tried both in "resizibletogglebutton2 > initialization > initialize" and "scratchviewermorph >     initialization > rebuildCategorySelectors" (I really need a tutorial on how to find what I'm looking for in Squeak... I keep getting confusing information and no search is able to show me what I need... really frustrating... I'm sure this is only due to the fact that I'm not a object-oriented guy  smile  so I really love Jens' javascript re-implementation of BYOB/Snap!  wink  ).

Anyway. All my attempts so far didn't give me black font. I could just get black labels for category buttons by direcly changing the labelColorOff/On/Over properties  "by hand" in the Inspector. But, of course, this is not a stable fix...

Offline

 

#6 2012-09-06 09:29:16

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: How to change color of Scratch Font

beat that
http://i.imgur.com/oCDoz.png

Offline

 

#7 2012-09-06 11:01:28

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: How to change color of Scratch Font

roijac wrote:

beat that
http://i.imgur.com/oCDoz.png

Is that Photoshop'd, or are you going to tell us how you did it?  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#8 2012-09-06 11:04:49

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

Re: How to change color of Scratch Font

I believe that text is part of the skin. The simplest solution is to right-click repeatedly on it until it reads "StringMorph" in pink under the text, then select the RED circular button above it, and finally select "change color" or something.


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

Offline

 

#9 2012-09-06 12:00:39

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: How to change color of Scratch Font

In ScratchViewerMorph rebuildCategorySelectors, change this line:
setLabelColor: Color white;

ResizableToggleButton2 initialize:
labelColorOff _ Color
                r: 78 / 255
                g: 82 / 255
                b: 82 / 255.
labelColorOn _ Color green.
labelColorOver _ labelColorOff

BlockMorph (class) initialize:
LabelColor _ Color white.

Open a transcript, then type this:
BlockMorph initialize

Highlight it all, then press Alt-D (or right-click then 'do it').

Click in the white space, choose open, then 'Scratch'.

Et voilà!

(Works for me, anyway...)


/* No comment */

Offline

 

#10 2012-09-06 14:17:38

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

TheSuccessor wrote:

Et voilà!

Thanks a lot! It worked also for me. Almost. I got label and block categories black, except for values in menus (e.g. variable and message names) and labels of hatblocks. Do you know how to change also their colors?

And, last but very important, can you see where I had made a mistake? I had already made these changes:

- setLabelColor in rebuildCategorySelectors
- labelColorOff/On/Over in initialize of ResizableToggleButton2

I just missed LabelColor in initialize of BlockMorph, as I was concentrated for now on categories. So I had also missed to call BlockMorph initialize.

After that I saved the end-user image and restarted Scratch, missing the step in which you suggest to reopen Scratch. Was this the reason for the black labels not showing up? What does this step really do? Thanks in advance!

Offline

 

#11 2012-09-06 14:31:34

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: How to change color of Scratch Font

s_federici wrote:

What does this step really do?

It creates the Scratch window again from scratch (no pun intended), forcing the StringMorphs to be remade with the new colours. Otherwise, Scratch will just use the existing ones, which still have the old colours.


/* No comment */

Offline

 

#12 2012-09-06 16:08:12

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

TheSuccessor wrote:

remade with the new colours

What you said suggested me a very drastic move: I changed the white color in the Color class to... black  smile  I think that it could work very well for me. The only problem is that even the arg backgrounds are black... I guess that moving the arg backgrounds back to white could be even more complex than just changing the color of the labels.

Offline

 

#13 2012-09-06 16:31:42

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

Ok! After having brought the white color in the Color class back to... white, I reduced the number of places where I still see white fonts:
- in Motion: "point towards" and "goto" menus
- in Control:
     - "when [green flag] clicked" label
     - items in "broadcast" and "when i receive" menus
     - sprite name in "when sprite1 clicked" label
- In Sensors:
     - items in "touching ?", "of Sprite1" and "distance from" menus

Any further suggestion?  smile

Offline

 

#14 2012-09-06 16:32:59

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: How to change color of Scratch Font

s_federici wrote:

I changed the white color in the Color class to... black  smile

That sounds like a really bad idea...  tongue  Will that even change the paint editor, too?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#15 2012-09-06 17:47:48

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

blob8108 wrote:

Will that even change the paint editor, too?

Not completely. I found two black squares in the paint editor, but then, when I clicked on the white color (among the grays) it changed back to white. And I could draw white shapes.

Offline

 

#16 2012-09-06 17:49:53

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to change color of Scratch Font

Digging and digging and alt-clicking everything on the block palette, I made it in the end! Thanks a lot to TheSuccessor that paved the way to my (I know, small) success. If anyone is interested in the full list of methods to be changed, just ask  smile

Offline

 

Board footer