# Combining multiple PShapes

**URL:** <https://discourse.processing.org/t/combining-multiple-pshapes/24326>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [October 4, 2020, 8:15am UTC](https://discourse.processing.org/t/combining-multiple-pshapes/24326 "2020-10-04T08:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tea](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@tea](https://discourse.processing.org/u/tea)\
**Post date:** [October 4, 2020, 8:15am UTC](https://discourse.processing.org/t/combining-multiple-pshapes/24326/1 "2020-10-04T08:15:12Z")

</div>

Sorry in advance if I’m asking in the wrong forum or doing anything wrong, I’ve only been at this for a couple weeks. It’s for a school assignment I’m stuck on for days already so I thought it’s time to ask for help.

I’m trying to make the image I drew with multiple primitive shapes “expand” from the center of the screen, growing bigger and bigger until it covers the entire screen. So the problem is, the image is drawn with primitive shapes and I can’t figure out how to expand it while keeping it proporsional.

I have tried multiple ways, and is currently trying to “combine” the image with PShape before expanding it, like so:

```auto
face = createShape ();
face.beginShape ();
face.noStroke ();
face.fill (242, 179, 20);
face.rect (100, 80, 180, 200, 100);

face.noStroke ();
face.fill (255, 255, 255);
face.ellipse (150, 170, 70, 70);
face.ellipse (230, 170, 70, 70);

face.noStroke ();
face.fill (50, 50, 50);
face.ellipse (160, 170, 20, 20);
face.ellipse (220, 170, 20, 20);

face.noStroke ();
face.fill (250, 78, 90);
face.arc (190, 210, 30, 30, 0, PI);

face.noStroke ();
face.fill (255, 255, 255);
face.rect (175, 205, 30, 5);

face.endShape (CLOSE);

```

The end result is error messages such as 'The function rect(int, int, int, int, int) does not exist, even though it shows just fine when I try it without PShape.

I’m not looking for a complete code or anything, just a pointer on where I went wrong? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 4, 2020, 9:27am UTC](https://discourse.processing.org/t/combining-multiple-pshapes/24326/2 "2020-10-04T09:27:45Z")

</div>

Hello,

You may glean some insight from:  
[https://processing.org/tutorials/pshape/](https://processing.org/tutorials/pshape/)

Examples in the PDE:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/05a0db62b5d14ee942a5475c12efefcdabcb762c.png)

And all the other resources…

One of the best tools in a programmer’s tool chest is knowing the resources available to you and learning to navigate, filter, and use them.

A short list of resources to peruse:

> **Resources \< Click here to expand !**
>
> Explore the resources available here:
> 
> - The Processing _website_ has references, examples, tutorials, links to resources, etc.  
> [https://processing.org/](https://processing.org/)
> 
> - The Processing PDE (IDE) has lots to offer!  
> An exploration of the menu bar will reveal what is available there;  
> libraries, tools, local examples, and other goodies are in there.
> 
> - The Coding Train \< Experience the unbridled enthusiasm of Daniel Shiffman  
> [https://shiffman.net/](https://shiffman.net/)  
> [https://www.youtube.com/user/shiffman](https://www.youtube.com/user/shiffman)  
> [https://thecodingtrain.com/](https://thecodingtrain.com/)
> 
> - Happy Coding  
> [Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)
> 
> - The source code can give insight if you are adventurous:  
> [GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)](https://github.com/processing/processing)
> 
> - Explore Processing on GitHub:  
> [Processing Foundation · GitHub](https://github.com/processing)  
> [processing/core/src/processing/core/PApplet.java at master · processing/processing · GitHub](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java) \< Many of the Processing functions are here!
> 
> - The Processing Foundation  
> [https://processingfoundation.org/](https://processingfoundation.org/)  
> Check out the menu.  
> In the education menu, there is a reference to the Coding Train.
> 
> - And the Internet. `:)`

`:)`

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [October 4, 2020, 11:08am UTC](https://discourse.processing.org/t/combining-multiple-pshapes/24326/3 "2020-10-04T11:08:53Z")

</div>

Yes see tutorial

You want to use GROUP
