# How to use PixelFlow to initialize a specific shape？

**URL:** https://discourse.processing.org/t/how-to-use-pixelflow-to-initialize-a-specific-shape/35554
**Category:** Libraries
**Created:** [March 4, 2022, 1:14pm UTC](https://discourse.processing.org/t/how-to-use-pixelflow-to-initialize-a-specific-shape/35554 "2022-03-04T13:14:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JawyZhang](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@JawyZhang](https://discourse.processing.org/u/JawyZhang)
#### Post date: [March 4, 2022, 1:14pm UTC](https://discourse.processing.org/t/how-to-use-pixelflow-to-initialize-a-specific-shape/35554/1 "2022-03-04T13:14:24Z")

</div>

I’m learning the example ‘Fluid\_GetStarted’, and I wanna create a rectangle fluid at the beginning.This rectangle will only be generated once so I don’t put my code in the ‘_fluid.update()_’. I find that `addDensity(processing.opengl.PGraphics2D pg, float intensity_scale, int blend_mode, float mix)`\* is in the reference. I’ve tried the code below in ‘_setup()_’ but it doesn’t work. Could anyone help me?

```auto
    pg2 = (PGraphics2D) createGraphics(width, height, P2D);
    pg2.beginDraw();
    pg2.clear();
    pg2.fill(255,255,0);
    pg2.rect(width/2,height/2,20,20);
    pg2.endDraw();
    fluid.addDensity(pg2,10,10,10);

```
