cocos2d-x  3.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cocosplay Namespace Reference

Functions

void  ()
bool  ()
 Checks whether CocosPlay is enabled. More...
 
bool  ()
 Checks whether CocosPlay is in demo mode. More...
 
void  (const std::string &filePath)
 Updates assets by filePath, if the file doesn't exist, CocosPlay will show a progress page of downloading. More...
 
bool  (const std::string &filePath)
 Checks whether the file exists. More...
 
void  (const std::string &filePath)
 Notifies to Cocos Play SDK that a file was loaded It will do nothing if game doesn't run on Cocos Play. More...
 
std::string  ()
 Gets the resource root path of current game. More...
 
void  ()
 Purges the file searching cache. More...
 
void  (const std::string &filePath)
 Purges the file searching cache by giving file path. More...
 
void  ()
 Notifies that the game demo was ended. More...
 

Function Documentation

void cocosplay::lazyInit ( )
bool cocosplay::isEnabled ( )

Checks whether CocosPlay is enabled.

bool cocosplay::isDemo ( )

Checks whether CocosPlay is in demo mode.

void cocosplay::updateAssets ( const std::string &  filePath)

Updates assets by filePath, if the file doesn't exist, CocosPlay will show a progress page of downloading.

And this interface will be hung up until the scene package was downloaded.

bool cocosplay::fileExists ( const std::string &  filePath)

Checks whether the file exists.

void cocosplay::notifyFileLoaded ( const std::string &  filePath)

Notifies to Cocos Play SDK that a file was loaded It will do nothing if game doesn't run on Cocos Play.

std::string cocosplay::getGameRoot ( )

Gets the resource root path of current game.

Returns
A writable path of current game
void cocosplay::purgeCachedEntries ( )

Purges the file searching cache.

Note
It should be invoked after the resources were updated. For instance, it could be used when there is a small update in games.
void cocosplay::purgeCachedByFile ( const std::string &  filePath)

Purges the file searching cache by giving file path.

void cocosplay::notifyDemoEnded ( )

Notifies that the game demo was ended.