Skip to content

Commit

Permalink
Updated Readme for 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BtheDestroyer committed Jul 26, 2016
1 parent d5df3aa commit efa0d17
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ If you have any suggestions or requests for future additions, please create an `
## What does this do?

### SpriteTools adds the following structures:
### 1.0 - First release
```C
st_anim{ //animations utilizing spritesheets
unsigned int frames; //number of frames in the animation
Expand Down Expand Up @@ -41,7 +42,24 @@ st_ent{ //entities and entity arrays utilizing animations and distinct universal
bool openSlot; //tells st_entity_add() if this entity can be written to and st_entity_render() if it should be rendered
}
```
### 1.1 - The Camera update
```C
st_cam {
int xPos; //x position of the center of the screen
int yPos; //y position of the center of the screen
float zoom; //how stretched/offset sprites on screen should be 1.0 for default
float rot; //how rotated the camera should be in radians
st_ent *follow;//which entitiy is to be followed with st_camera_move_follow() and related functions
}
```
### Spritetools adds the following global variables:
### 1.1 - The Camera update
```C
//this is a pointer used in functions like st_entity_render_camera_main()
st_cam *st_MainCamera
```
### Spritetools adds the following functions:
### 1.0 - First release
```C
//displays selected frame of animation at selected X and Y coordinates
st_animation_frame(st_anim anim, int frame, int xrend, int yrend)
Expand Down Expand Up @@ -76,6 +94,95 @@ st_entity_render(st_ent ent[], int total)
//Gets player input and moves st_ents accordingly
st_entity_move_player(st_ent ent[], int total)
```
### 1.1 - The Camera update
```C
//returns an st_anim with less inputs than st_animation_create
st_anim st_animation_create_simple(sf2d_texture *texture, int frames, int width, int height)
//displays current frame of animation at selected X and Y coordinates and stretches it a certain amount, then adds 1 to currentframe
void st_animation_play_stretch(st_anim *panim, int xrend, int yrend, float stretch)
//Adds an st_ent to the first open slot available. returns false if no slot is open
bool st_entity_add_simple(st_ent ent[], int total, st_anim anim0, int x, int y, int xhot, int yhot, int speed, int control)
//Prints the given slots' structure of an st_ent array
void st_entity_print_array(st_ent ent[], int total)
//returns an st_anim
st_anim st_animation_create(sf2d_texture *texture, int frames, int framepause, int ytop, int xleft, int width, int height)
//returns an st_cam
st_cam st_camera_create(int xPos, int yPos, float zoom, float rot, st_ent *follow)
//returns an st_cam with less inputs than st_camera_create
st_cam st_camera_create_simple(int xPos, int yPos)
//sets the main camera to the supplied cam.
void st_camera_setmain(st_cam* cam)
//moves an st_cam to given position
void st_camera_move(st_cam *pcam, int xPos, int yPos)
//moves an st_cam to given x position
void st_camera_move_x(st_cam *pcam, int xPos)
//moves an st_cam to given y position
void st_camera_move_y(st_cam *pcam, int yPos)
//moves an st_cam to given st_ent's position
void st_camera_move_ent(st_cam *pcam, st_ent ent)
//moves an st_cam to given st_ent's position
void st_camera_move_ent_offset(st_cam *pcam, st_ent ent, int xOff, int yOff)
//moves an st_cam the st_ent it's following
void st_camera_move_follow(st_cam *pcam)
//moves an st_cam to the st_ent it's following with an x and y offset
void st_camera_move_follow_offset(st_cam *pcam, int xOff, int yOff)
//changes what st_ent an st_cam is following
void st_camera_follow(st_cam *pcam, st_ent *pent)
//changes what st_ent an st_cam is following and moves it there
void st_camera_follow_move(st_cam *pcam, st_ent *pent)
//adds a float to an st_cam's rotation
void st_camera_rotate(st_cam *pcam, float rot)
//sets an st_cam's rotation to a float
void st_camera_rotate_set(st_cam *pcam, float rot)
//adds a float to an st_cam's zoom
void st_camera_zoom(st_cam *pcam, float zoom)
//sets an st_cam's zoom to a float
void st_camera_zoom_set(st_cam *pcam, float zoom)
//Renders all st_ents in relation to an st_cam
void st_entity_render_camera(st_ent ent[], int total, st_cam cam)
//Renders all st_ents in relation to an st_cam WITHOUT stretching
void st_entity_render_camera_nostretch(st_ent ent[], int total, st_cam cam)
//Renders all st_ents in relation to an st_cam WITHOUT rotation
void st_entity_render_camera_norotation(st_ent ent[], int total, st_cam cam)
//Renders all st_ents in relation to an st_cam WITHOUT stretching OR rotation
void st_entity_render_camera_nostretch_norotation(st_ent ent[], int total, st_cam cam)
//Renders all st_ents in relation to the main st_cam
void st_entity_render_camera_main(st_ent ent[], int total)
//Renders all st_ents in relation to the main st_cam WITHOUT stretching
void st_entity_render_camera_main_nostretch(st_ent ent[], int total)
//Renders all st_ents in relation to the main st_cam WITHOUT rotation
void st_entity_render_camera_main_norotation(st_ent ent[], int total)
//Renders all st_ents in relation to the main WITHOUT stretching OR rotation
void st_entity_render_camera_main_nostretch_norotation(st_ent ent[], int total)
```

## License
Anyone can use SpriteTools in their project so long as the following line (or one with the same information) of credit and a link to this page are provided:
Expand Down

0 comments on commit efa0d17

Please sign in to comment.