aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/sprite_sheet.h
blob: 1ca72a58926475ce9b20ae7cd184f71b2d323c22 (plain)
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
37
38
39
40
41
42
43
44
45
#ifndef __JE_SPRITE_SHEET_H__
#define __JE_SPRITE_SHEET_H__

#include <vector>

#include "../math/quad.h"

#include "sprite.h"

namespace JinEngine
{
	namespace Graphics
	{

		class SpriteSheet : public Object
		{
		public:
			SpriteSheet(const Graphic* graphic);

			///
			/// Create a new sprite in sheet.
			///
			Sprite* createSprite(const Math::Quad& quad, Origin origin);

			///
			/// Create a new sprite in sheet.
			///
			Sprite* createSprite(const Math::Quad& quad, float ox, float oy);

			///
			///
			///
			std::vector<Sprite*> createSprites(uint count, uint row, uint colum, uint w, uint h, Origin origin = Origin::TOPLEFT, uint offx = 0, uint offy = 0);

			std::vector<Sprite*> createSprites(uint count, uint row, uint colum, uint w, uint h, float ox = 0, float oy = 0, uint offx = 0, uint offy = 0);

		private: 
			const Graphic* const mGraphic;

		};

	} // namespace Graphics 
} // namespace JinEngine 

#endif