-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsprite.h
36 lines (33 loc) · 823 Bytes
/
sprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "raylib.h"
#include "constants.h"
#include <Math.h>
class sprite
{
public:
sprite(char files[], Vector2 pos, Vector2 size);
void draw(bool allowedOutOfBounds);
void setPosition(int xPos, int yPos);
void transform(int deltaX, int deltaY);
void rotate(int degrees);
void setRotation(int);
void flipX();
void setXFlip(bool);
Vector2 getSize();
Rectangle getCollider();
int getX();
int getY();
void setPos(Vector2);
sprite();
void setTint(Color);
void setFlippedTexture(char file[]);
void normalise(Vector2 &vector);
void scale(Vector2 &vector, int scale);
protected:
bool flipped;
Texture2D normalTexture, flippedTexture;
int x, y, width, height, rotation;
int pause;
bool touchingWall;
Color tint;
};