Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ManojTGN committed Apr 7, 2023
2 parents 91eef16 + 3af7a86 commit c42f237
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 3 deletions.
41 changes: 40 additions & 1 deletion docs/README-Font.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@


# createGrafixFont
```c
createGrafixFont(grafixFont *font, char* directory ,int fontSize)
```
Get the window's Frame Per Seconds `(FPS)`
`window` - window object | `grafixWindow` <br>
`directory` - the path to the font file | `char*` <br>
`fontSize` - setting the fontSize for the GrafixFont | `int` <br>
returns nothing | `void`
## Example
```c
grafixFont FONT;
createGrafixFont(&FONT,"jbr.ttf",16);
```
<br>

# drawGrafixText
```c
drawGrafixText(grafixWindow window, grafixFont font, int x, int y, char* text, grafixColor color)
```
`window` - window object | `grafixWindow` <br>
`font` - set the font | `grafixFont` <br>
`x` - x position of the text | `int` <br>
`y` - y position of the text | `int` <br>
`text` - text should be rendered on the frame | `char*` <br>
`color` - text color | `grafixColor` <br>
returns nothing | `void`
## Example
```c
grafixFont FONT;
createGrafixFont(&FONT,"jbr.ttf",16);
drawGrafixText(window,FONT,10,10,"Hello cGrafix",WHITE);
```
<br>
61 changes: 59 additions & 2 deletions docs/README-Image.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,59 @@


# createGrafixImage
```c
createGrafixImage(grafixImage *image, const char* filePath, int fileType)
```
Note: Only supports `.BMP` file formats
reads the image file and set the data to the image object.
`window` - window object | `grafixWindow` <br>
`filePath` - the file path to the image | `grafixWindow` <br>
`fileType` - the extension or type of the file. Currently it has 3 types | `int` <br>
- `FT_BMP`
- `FT_PNG`
- `FT_JPG`
returns `1` if the image creation is successfull else `0` | `int`
## Example
```c
grafixImage image;
createGrafixImage(&image,"cgrafix.bmp",FT_BMP);
```
<br>

# drawGrafixImage
```c
drawGrafixImage(grafixWindow window, grafixImage image, int x, int y)
```
render the image to the frame of the specified window
`window` - window object | `grafixWindow` <br>
`image` - image object | `grafixImage` <br>
`x` - starting position of the image's x axis | `int` <br>
`y` - starting position of the image's y axis | `int` <br>
returns nothing | `void`
## Example
```c
drawGrafixImage(window,image,100,100);
```
<br>

# rotateGrafixImage `development`
```c
rotateGrafixImage(grafixImage *image, float angle)
```
Rotate the image in clockwise direction with the specified angle.
`image` - image object | `grafixImage` <br>
`angle` - image rotation angle 0.0-360.0 | `float` <br>
returns nothing | `void`
## Example
```c
waitGrafixWindow(window, 1000);
```
<br>

0 comments on commit c42f237

Please sign in to comment.