123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- #ifndef __SUPPORT_CC_UTILS_H__
- #define __SUPPORT_CC_UTILS_H__
- #include <vector>
- #include <string>
- #include "2d/CCNode.h"
- #include "base/ccMacros.h"
- NS_CC_BEGIN
- int ccNextPOT(int value);
- class Sprite;
- class Image;
- namespace utils
- {
-
- CC_DLL void captureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename);
-
- CC_DLL Image* captureNode(Node* startNode, float scale = 1.0f);
-
-
- CC_DLL std::vector<Node*> findChildren(const Node &node, const std::string &name);
-
-
- CC_DLL double atof(const char* str);
-
- CC_DLL double gettime();
-
- CC_DLL long long getTimeInMilliseconds();
-
- CC_DLL Rect getCascadeBoundingBox(Node *node);
-
- CC_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key);
-
- CC_DLL Sprite* createSpriteFromBase64(const char* base64String);
-
- CC_DLL Node* findChild(Node* levelRoot, const std::string& name);
-
- CC_DLL Node* findChild(Node* levelRoot, int tag);
-
- template<typename T> inline
- T findChild(Node* levelRoot, const std::string& name)
- {
- return dynamic_cast<T>(findChild(levelRoot, name));
- }
-
- template<typename T> inline
- T findChild(Node* levelRoot, int tag)
- {
- return dynamic_cast<T>(findChild(levelRoot, tag));
- }
-
- CC_DLL std::string getFileMD5Hash(const std::string &filename);
- }
- NS_CC_END
- #endif
|