mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Changed Atlas constructor to take a path.
This commit is contained in:
parent
6addb86a40
commit
6e7e8c5512
@ -51,7 +51,7 @@ class Atlas: public BaseAtlas {
|
||||
public:
|
||||
Atlas (std::ifstream &file);
|
||||
Atlas (std::istream &input);
|
||||
Atlas (const std::string &text);
|
||||
Atlas (const std::string &path);
|
||||
Atlas (const char *begin, const char *end);
|
||||
|
||||
AtlasRegion* findRegion (const std::string &name);
|
||||
|
||||
@ -34,9 +34,7 @@ using namespace spine;
|
||||
int main () {
|
||||
|
||||
try {
|
||||
ifstream atlasFile("../data/spineboy.atlas");
|
||||
Atlas *atlas = new Atlas(atlasFile);
|
||||
|
||||
Atlas *atlas = new Atlas("../data/spineboy.atlas");
|
||||
SkeletonJson json(atlas);
|
||||
SkeletonData *skeletonData = json.readSkeletonDataFile("../data/spineboy-skeleton.json");
|
||||
Animation *animation = json.readAnimationFile("../data/spineboy-walk.json", skeletonData);
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
#include <SFML/Graphics/Texture.hpp>
|
||||
#include <spine-sfml/Atlas.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
namespace spine {
|
||||
|
||||
@ -42,8 +44,9 @@ Atlas::Atlas (std::istream &input) {
|
||||
load(input);
|
||||
}
|
||||
|
||||
Atlas::Atlas (const std::string &text) {
|
||||
load(text);
|
||||
Atlas::Atlas (const std::string &path) {
|
||||
std::ifstream file("../data/spineboy.atlas");
|
||||
load(file);
|
||||
}
|
||||
|
||||
Atlas::Atlas (const char *begin, const char *end) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user