-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathCCINode.h
111 lines (83 loc) · 2.51 KB
/
CCINode.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//
// CCINode.h
// CocosInterpreterTest
//
// Created by Wu Tong on 13-4-7.
//
//
#ifndef __CocosInterpreter__CCINode__
#define __CocosInterpreter__CCINode__
#include "base_nodes/CCNode.h"
#include "ExtensionMacros.h"
#include "CCIMovie.h"
#include "CCDictionary.h"
#include "CCIFillStyleArray.h"
#include "CCICxformWithAlpha.h"
NS_CC_EXT_BEGIN
/**
* Data source that governs table backend data.
*/
class CCINodeFrameDelegate
{
public:
/**
* cell height for a given table.
*
* @param table table to hold the instances of Class
* @return cell size
*/
virtual void didEnterFrame(int frameIndex,std::string frameLabel) = 0;
};
class CCINode:public CCNode{
private:
CCINode();
virtual ~CCINode();
float frameRate;
int frameCount;
bool initWithFile(std::string cci_filename);
void showFrame();
CCIMovie * swfMovie;
std::vector<CCIMovieTag *> tags;
CCDictionary * textures;
CCDictionary * nodes;
int currentTag = 0;
int currentFrame = 1;
bool isPlayingFrameLabel = false;
int frameLabelIndex = 0;
std::string frameLabel = "";
bool isPlaying;
CCINodeFrameDelegate * delegate = NULL;
static CCINode* createWithTags(std::vector<CCIMovieTag *> tags,CCIMovie * swfMovie,CCDictionary * nodes);
bool initWithTags(std::vector<CCIMovieTag *> tags,CCIMovie * swfMovie,CCDictionary * nodes);
void applyColorTransform(CCNode * node,ccColor4B colorTransform);
void applySkew(CCNode * node,float skewX,float skewY,bool isInner);
public:
static CCINode* create(std::string cci_filename);
//play anyway
void play();
void stop();
void gotoAndPlay(std::string frameFlag);
float getFrameRate();
void setFrameRate(float frameRate);
void setFlipX(bool flipX);
void setFlipY(bool flipY);
void setResize(float resize);
virtual void setScaleX(float scaleX);
virtual void setScaleY(float scaleY);
void setScale(float scale);
virtual float getScaleX();
virtual float getScaleY();
float getScale();
void setDelegate(CCINodeFrameDelegate * delegate);
CCINodeFrameDelegate * getDelegate();
private:
void fillNodeWithStyle(CCIFillStyleArray * fillStyles,CCNode * node,CCIRect * nodeBounds);
void loadImages();
float resize = 1.0;
bool flipX = false;
bool flipY = false;
float originalScaleX = 1.0;
float originalScaleY = 1.0;
};
NS_CC_EXT_END
#endif /* defined(__CocosInterpreterTest__CCINode__) */