# I want to change the size of each class

**URL:** <https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205>\
**Category:** Coding Questions\
**Created:** [May 23, 2020, 8:08am UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205 "2020-05-23T08:08:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeon](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@yeon](https://discourse.processing.org/u/yeon)\
**Post date:** [May 23, 2020, 8:08am UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205/1 "2020-05-23T08:08:22Z")

</div>

I’m making a game with processing.  
I want to change the size of each class.  
What should I do?

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 23, 2020, 8:34am UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205/2 "2020-05-23T08:34:28Z")

</div>

Hi,

Welcome to the community! 😉

What do you mean by changing the size of each class? Do you talk about Java classes or objects in your game?

Could you give more context so people can help you?

---

<div class="post-metadata">

**Author:** ![yeon](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@yeon](https://discourse.processing.org/u/yeon)\
**Post date:** [May 23, 2020, 8:44am UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205/3 "2020-05-23T08:44:59Z")

</div>

I’m making assorted games. So I want to change the size of each game.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 23, 2020, 8:50am UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205/4 "2020-05-23T08:50:06Z")

</div>

Hi,

This is still not very clear, do you mind showing an actual image of your project or a piece of code?

If you talk about size, check out the [`scale()`](https://processing.org/reference/scale_.html) function.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 25, 2020, 8:39pm UTC](https://discourse.processing.org/t/i-want-to-change-the-size-of-each-class/21205/5 "2020-05-25T20:39:55Z")

</div>

There are many ways of “changing the size” that could mean the width/height, or it could mean the scale(), or the count (of items in a loop, or in an array) et cetera.

Here are two examples of changing size related to a class. There are many more.

```auto
ChangeWH cwh, cwh2;
ChangeCount cc, cc2;
void setup() {
  size(450, 320);
  cwh = new ChangeWH(100, 100);
  cwh2 = new ChangeWH(50, 300);  
  cc = new ChangeCount(5);
  cc2 = new ChangeCount(20);
}

void draw() {
  background(128);
  translate(10,10);
  cwh.display();
  translate(110,0);
  cwh2.display();
  translate(110,0);
  cc.display();
  translate(110,0);
  cc2.display();
}

class ChangeWH {
  int w, h;
  ChangeWH(int w, int h) {
    this.w = w;
    this.h = h;
  }
  void display() {
    rect(0, 0, w, h);
  }
}

class ChangeCount {
  int count;
  ChangeCount(int count) {
    this.count = count;
  }
  void display() {
    for (int i=0; i<count; i++) rect(0, i*10, 100, 100);
  }
}

```

 ![Screen Shot 2020-05-25 at 1.39.32 PM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/65bb90ea01b49dd4102753164a07ca3216598138.png)
