# Text random position

**URL:** <https://discourse.processing.org/t/text-random-position/39571>\
**Category:** Coding Questions\
**Created:** [November 3, 2022, 11:49am UTC](https://discourse.processing.org/t/text-random-position/39571 "2022-11-03T11:49:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moonshiner](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@Moonshiner](https://discourse.processing.org/u/Moonshiner)\
**Post date:** [November 3, 2022, 11:49am UTC](https://discourse.processing.org/t/text-random-position/39571/1 "2022-11-03T11:49:41Z")

</div>

Hey guys, I’m new to processing. I need a text at a random Position.  
But text(“Hello”,random(1,500)); isn’t allowed. How do i do that ?  
Thank you in Advance

---

<div class="post-metadata">

**Author:** ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)\
**Post date:** [November 3, 2022, 12:08pm UTC](https://discourse.processing.org/t/text-random-position/39571/2 "2022-11-03T12:08:10Z")

</div>

Hello, @Moonshiner, and welcome to the Processing Foundation Forum!

See the reference for the `text()` function here:

> **[Reference](https://processing.org/reference/text_.html)**
>
> Draws text to the screen. Displays the information specified in the first parameter on the screen in the position specified by the additional parameters. A default font will be used unless a font is s…

Note that it needs three arguments, the first to specify the text to be displayed, and the second and third to specify the coordinates. You have only passed one argument to the `text()` function, which is a call to the `random()` function. Instead, for what you are trying to do, two calls to the `random()` function are needed in the list of arguments, one for each coordinate.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [November 22, 2022, 7:37pm UTC](https://discourse.processing.org/t/text-random-position/39571/3 "2022-11-22T19:37:02Z")

</div>

Hi

```auto
void setup() 
{
  size(1000, 800);
  textSize(128);
  //text("HELLO", 40, 120); 
  frameRate(5);
}

void draw() 
{

  background (0, 0, 255);
  float r = random(50);
  text("HELLO", r*10, 420);
}

```
