Learning LibraryDigital Art LibraryKids

Imported art pieces: build scenes from ready-made shapes

You don't redraw a star every time. You import it once and reuse it. Those ready-made pieces are the building blocks for a whole scene.

The big idea

Imported shapes are reusable pieces you combine to build a bigger picture.

See it in code

1Start simple

You don't draw a star from scratch. You import it once, then use it. Here we import star and place it a single time:

python
from art import Canvas, star

screen = Canvas.create()
Canvas.fill(screen)

star(screen, 250, 250, size=100)
Run it — one imported piece, placed once:
A single yellow star placed in the center of a dark canvas.

The star was ready-made. We imported it, then just chose where it goes.

2A step further

Import a second piece and combine them. Now we have star and flower — two ready-made shapes in one picture:

python
from art import Canvas, star, flower

screen = Canvas.create()
Canvas.fill(screen)

star(screen, 170, 220, size=90)
flower(screen, 320, 320, size=90)
Run it — two imported pieces together:
A yellow star near the top and a pink flower lower down on a dark canvas.

Each piece was imported once. Adding more just means more import names — and more to arrange.

3In our world

Now build a whole scene from those two pieces. Flowers along the bottom. A big star like a sun. Small stars twinkling above:

python
from art import Canvas, star, flower

screen = Canvas.create()
Canvas.fill(screen)

flower(screen, 150, 380, size=90)
flower(screen, 350, 380, size=90)
star(screen, 250, 130, size=100)
star(screen, 110, 190, size=40)
star(screen, 390, 190, size=40)
Run it — a scene built from a few imported pieces:
A dark canvas scene: two pink flowers along the bottom, a big star like a sun, and two small stars above.

Two shapes, five spots, one scene. The pieces are imported and ready. So you spend your time arranging — the fun part — not redrawing.

The same idea, everywhere

Real projects are built from reusable pieces. A game reuses a coin. A website reuses a button. A comic reuses a character. Make a good piece once, then use it again and again.

Try it yourself

Add three more small stars to fill the sky. Then add a flower in the center — does the scene feel fuller, or too busy?

The common mistake

Trying to use a piece you didn't import. You can only place star and flower if they're on your from art import ... line. Import the pieces you want first, then compose.

What it unlocks

Composing pieces builds on imports and pygame drawing, and rewards good composition.