rename node.hpp to cocos.hpp + add function for checking if sprite

exists
This commit is contained in:
HJfod 2022-04-28 11:45:18 +03:00
parent 138eddc36d
commit d1c83b5dae
3 changed files with 14 additions and 3 deletions

View file

@ -11,7 +11,6 @@ namespace geode::cast {}
namespace geode::cocos {}
namespace geode::utils {}
namespace geode::helper {}
namespace geode::node {}
namespace geode::op {}
namespace geode::stream {}
namespace geode::view {}
@ -25,7 +24,6 @@ namespace cocos2d::extension {}
using namespace geode::cocos; \
using namespace geode::helper; \
using namespace geode::utils; \
using namespace geode::node; \
using namespace geode::op; \
using namespace geode::stream; \
using namespace geode::view; \

View file

@ -68,4 +68,17 @@ namespace geode::cocos {
* not take into account if node is off-screen
*/
GEODE_DLL bool nodeIsVisible(cocos2d::CCNode* node);
/**
* Checks if a given file exists in CCFileUtils
* search paths.
* @param filename File to check
* @returns True if file exists
* @example if (fileExistsInSearchPaths("mySprite.png"_spr)) {
* CCSprite::create("mySprite.png"_spr);
* } else {
* CCSprite::create("fallback.png");
* }
*/
GEODE_DLL bool fileExistsInSearchPaths(const char* filename);
}

View file

@ -9,5 +9,5 @@
#include "timer.hpp"
#include "ext.hpp"
#include "convert.hpp"
#include "node.hpp"
#include "cocos.hpp"
#include "operators.hpp"