Sets the color of the sprite placeholder rectangle for every sprite in the group.
The default color is gray. You can assign the color in one of two ways. It can be:
rgb()
command.var group = createGroup(); group.add(createSprite(100, 200)); group.add(createSprite(300, 200)); function draw() { background("white"); drawSprites(); if (mouseDown("leftButton")){ group.setColorEach("yellow"); } else { group.setColorEach("green"); } }
group.setColorEach(color)
Name | Type | Required? | Description |
---|---|---|---|
color | Color | The lowercase name of a color inside " " or a call to the rgb() command. |
No return value. Changes output in the display after drawSprites() is called.
rgb()
as a parameter to fill instead of a color name.drawSprites()
is called.Found a bug in the documentation? Let us know at documentation@code.org