# Don't know how to activate method

**URL:** https://discourse.processing.org/t/dont-know-how-to-activate-method/12982
**Category:** Beginners
**Created:** [July 25, 2019, 8:25pm UTC](https://discourse.processing.org/t/dont-know-how-to-activate-method/12982 "2019-07-25T20:25:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kosi559](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kosi559](https://discourse.processing.org/u/kosi559)
#### Post date: [July 25, 2019, 8:25pm UTC](https://discourse.processing.org/t/dont-know-how-to-activate-method/12982/1 "2019-07-25T20:25:09Z")

</div>

_I am a beginner at Java_

```auto
    public void drawScore() {
        scoreFont = createFont("Bauhaus 93", 26, true);
        textFont(scoreFont);
        fill(255,255,255);
        textAlign(CENTER);
        text("Score: " + score, width - 90, 40);
    }

```

I don’t know how to make it so that it actually functions when I run the program.

---

<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: [July 25, 2019, 8:31pm UTC](https://discourse.processing.org/t/dont-know-how-to-activate-method/12982/2 "2019-07-25T20:31:34Z")

</div>

[https://processing.org/tutorials/](https://processing.org/tutorials/)

Java calls them methods and Processing calls them functions:  
[https://processing.org/examples/functions.html](https://processing.org/examples/functions.html)

---

<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: [July 25, 2019, 9:20pm UTC](https://discourse.processing.org/t/dont-know-how-to-activate-method/12982/3 "2019-07-25T21:20:05Z")

</div>

> [@kosi559](#):
>
> drawScore() {

In draw() say:

drawScore();

this calls / runs the function you defined above

---

<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: [July 25, 2019, 10:29pm UTC](https://discourse.processing.org/t/dont-know-how-to-activate-method/12982/4 "2019-07-25T22:29:54Z")

</div>

actually, to save processor time, it’s wise to initialize the font in `setup()` (which runs only once, whereas `draw()` runs on and on 60 times per second (and so does `drawScore()` when you call it from `draw()`))

- So I did a bit of a re-write here

Chrisir

```auto

PFont scoreFont;
int score=0; 

void setup() {
  size (1400, 800);
  background(0);

  scoreFont = createFont("Bauhaus 93", 26, true);
}

void draw() {
  background(0); 
  drawScore();
}

void drawScore() {
  textFont(scoreFont);
  fill(255, 255, 255);
  textAlign(CENTER);
  text("Score: " + score, 
    width - 90, 40);
}
//

```
