Skip to content

Commit

Permalink
Merge pull request #91 from Schulich-Ignite/dev
Browse files Browse the repository at this point in the history
Version 0.1.1
  • Loading branch information
AlphaRLee authored Nov 25, 2020
2 parents eb0e2c8 + 0d606f3 commit 3b1f6df
Show file tree
Hide file tree
Showing 19 changed files with 3,335 additions and 5 deletions.
Binary file added docs/img/fill_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/square_comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/stroke_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions docs/shapes_text.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,108 @@ Results in:

![stroke_rect() example](img/stroke_rect.png)

### Squares

To create a square there are 3 options:

| Function | Description |
|------------------------------------------|----------------------------------------------------|
| [square(x, y, s)](#square) | Draw a square filled with color, and with a stroke |
| [fill_square(x, y, s)](#fill_square) | Draw an square filled with a color |
| [stroke_square(x, y, s)](#stroke_square) | Draw the outline of a square (its stroke) |

<figure>
<img src="https://spark.schulichignite.com/img/squares_comparison.png"/>
<figcaption>Comparison of 3 functions, note the red color was added for visibility, by default fill is black</figcaption>
</figure>

#### square()
```python
square(x, y, s)
```

**Parameters**

- x: (int or float) The value of the x position of the square
- y: (int or float) The value of the y position of the square
- s: (int or float) The width and height of the square

**Example(s):**

*Creating a filled and stroked square at (100, 100) with a width and height of 75*

```python hl_lines="7"
%%ignite

def setup():
size(200, 200)

def draw():
square(100, 100, 75)
```

Results in:

![square() example](img/square.png)

#### fill_square()
```python
fill_square(x, y, s)
```

**Parameters**

- x: (int or float) The value of the x position of the square
- y: (int or float) The value of the y position of the square
- s: (int or float) The width and height of the square

**Example(s):**

*Creating a filled square at (100, 100) with a width and height of 75*

```python hl_lines="7"
%%ignite

def setup():
size(200, 200)

def draw():
fill_square(100, 100, 75)
```

Results in:

![fill_square() example](img/fill_square.png)

#### stroke_square()
```python
stroke_square(x, y, s)
```

**Parameters**

- x: (int or float) The value of the x position of the square
- y: (int or float) The value of the y position of the square
- s: (int or float) The width and height of the square

**Example(s):**

*Creating a stroked square at (100, 100) with a width and height of 75*

```python hl_lines="7"
%%ignite

def setup():
size(200, 200)

def draw():
stroke_square(100, 100, 75)
```

Results in:

![stroke_square() example](img/stroke_square.png)

### Circles

To create a circle there are 3 options:
Expand Down
Loading

0 comments on commit 3b1f6df

Please sign in to comment.