This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Animate Your Name Forum

View Course

2375 points
571828824b7f51f26c000619_875219903
Submitted by
Maciej Wiercioch
about 3 years ago

Can I change the size of the dots?

As you should know from How does alphabet.js work?, the third value (with index 2, because we are counting from 0) of every point object corresponds to the size of the dot. So we have to multiply or add desired value to point[2]. If you change the size of the font then you probably want to multiply it by fontSizeMultiplier, this is very good idea! You have only to change this parameter of g.push method:

point[2],

into:

point[2] * fontSizeMultiplier,

But if you want to change only size of the dots - feel free to do that as well. If you want to make dots two times bigger your code should look like this:

if (document.alphabet.hasOwnProperty(cc_hex)) {
    var chr_data = document.alphabet[cc_hex].P;
    var bc = letterColors[ix % letterColors.length];

    for (var i = 0; i < chr_data.length; ++i) {
        point = chr_data[i];

        g.push(new Point(point[0] + offset,
            point[1],
            0.0,

            // because of this multiplication our dots will be two times bigger 
            point[2] * 2,

            makeColor(bc, point[3])));
    }
    offset += document.alphabet[cc_hex].W;
}

example of big dots


Return to Frequently Asked Questions