Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Assets_manager

Classes

class  AssetsManager
 This class is used to auto update resources, such as pictures or scripts. More...
 
class  AssetsManagerDelegateProtocol
 This class is the delegate for receving events during update process of AssetsManager. More...
 
class  AssetsManagerEx
 This class is used for resources hot update, you can update images or scripts during runtime of the game. More...
 
class  EventAssetsManagerEx
 EventAssetsManagerEx is the event class which will be distributed during AssetsManagerEx updating process. More...
 
class  EventListenerAssetsManagerEx
 The event listener for receving events during AssetsManagerEx update process. More...
 
class  Manifest
 Manifest is an abstraction of the assets list. More...
 
struct  Manifest::Asset
 The asset object. More...
 
struct  Manifest::AssetDiff
 Object indicate the difference between two Assets. More...
 

Enumerations

enum  ErrorCode { CREATE_FILE, NETWORK, NO_NEW_VERSION, UNCOMPRESS }
 Error code that can be notified to listener. More...
 
enum  State {
  UNCHECKED, PREDOWNLOAD_VERSION, DOWNLOADING_VERSION, VERSION_LOADED,
  PREDOWNLOAD_MANIFEST, DOWNLOADING_MANIFEST, MANIFEST_LOADED, NEED_UPDATE,
  UPDATING, UP_TO_DATE, FAIL_TO_UPDATE
}
 Update states. More...
 
enum  EventCode {
  ERROR_NO_LOCAL_MANIFEST, ERROR_DOWNLOAD_MANIFEST, ERROR_PARSE_MANIFEST, NEW_VERSION_FOUND,
  ALREADY_UP_TO_DATE, UPDATE_PROGRESSION, ASSET_UPDATED, ERROR_UPDATING,
  UPDATE_FINISHED, UPDATE_FAILED, ERROR_DECOMPRESS
}
 Update events code. More...
 
enum  DiffType { ADDED, DELETED, MODIFIED }
 Type of difference between local and remote asset. More...
 
enum  DownloadState { UNSTARTED, DOWNLOADING, SUCCESSED }
 Download state of a updating asset. More...
 

Detailed Description

Enumeration Type Documentation

enum ErrorCode
strong

Error code that can be notified to listener.

Enumerator
CREATE_FILE 

Error caused by creating a file to store downloaded data.

NETWORK 

Errors caused by network, there are the following possibilities:

  • network unavaivable
  • timeout
  • ...
NO_NEW_VERSION 

There is not a new version.

UNCOMPRESS 

Error caused in uncompressing stage.

  • can not open zip file
  • can not read file global information
  • can not read file information
  • can not create a directory
  • ...
var ErrorCode
strong

Error code that can be notified to listener.

Enumerator
CREATE_FILE 

Error caused by creating a file to store downloaded data.

NETWORK 

Errors caused by network, there are the following possibilities:

  • network unavaivable
  • timeout
  • ...
NO_NEW_VERSION 

There is not a new version.

UNCOMPRESS 

Error caused in uncompressing stage.

  • can not open zip file
  • can not read file global information
  • can not read file information
  • can not create a directory
  • ...
local ErrorCode
strong

Error code that can be notified to listener.

Enumerator
CREATE_FILE 

Error caused by creating a file to store downloaded data.

NETWORK 

Errors caused by network, there are the following possibilities:

  • network unavaivable
  • timeout
  • ...
NO_NEW_VERSION 

There is not a new version.

UNCOMPRESS 

Error caused in uncompressing stage.

  • can not open zip file
  • can not read file global information
  • can not read file information
  • can not create a directory
  • ...
enum State
strong

Update states.

Enumerator
UNCHECKED 

Unchecked whether there is a new version.

PREDOWNLOAD_VERSION 

Before downloading the version manifest file.

DOWNLOADING_VERSION 

Downloading the version manifest file.

VERSION_LOADED 

After successfully downloaded and parsed the version manifest.

PREDOWNLOAD_MANIFEST 

Before downloading the resources manifest file.

DOWNLOADING_MANIFEST 

Downloading the resources manifest file.

MANIFEST_LOADED 

After successfully downloaded and parsed the resources manifest.

NEED_UPDATE 

New version detected, needed to be updated.

UPDATING 

Updating new version.

UP_TO_DATE 

Updated to the latest version.

FAIL_TO_UPDATE 

Failed to update new version.

var State
strong

Update states.

Enumerator
UNCHECKED 

Unchecked whether there is a new version.

PREDOWNLOAD_VERSION 

Before downloading the version manifest file.

DOWNLOADING_VERSION 

Downloading the version manifest file.

VERSION_LOADED 

After successfully downloaded and parsed the version manifest.

PREDOWNLOAD_MANIFEST 

Before downloading the resources manifest file.

DOWNLOADING_MANIFEST 

Downloading the resources manifest file.

MANIFEST_LOADED 

After successfully downloaded and parsed the resources manifest.

NEED_UPDATE 

New version detected, needed to be updated.

UPDATING 

Updating new version.

UP_TO_DATE 

Updated to the latest version.

FAIL_TO_UPDATE 

Failed to update new version.

local State
strong

Update states.

Enumerator
UNCHECKED 

Unchecked whether there is a new version.

PREDOWNLOAD_VERSION 

Before downloading the version manifest file.

DOWNLOADING_VERSION 

Downloading the version manifest file.

VERSION_LOADED 

After successfully downloaded and parsed the version manifest.

PREDOWNLOAD_MANIFEST 

Before downloading the resources manifest file.

DOWNLOADING_MANIFEST 

Downloading the resources manifest file.

MANIFEST_LOADED 

After successfully downloaded and parsed the resources manifest.

NEED_UPDATE 

New version detected, needed to be updated.

UPDATING 

Updating new version.

UP_TO_DATE 

Updated to the latest version.

FAIL_TO_UPDATE 

Failed to update new version.

enum EventCode
strong

Update events code.

Enumerator
ERROR_NO_LOCAL_MANIFEST 

Local manifest not found error.

ERROR_DOWNLOAD_MANIFEST 

Remote manifest download failed.

ERROR_PARSE_MANIFEST 

Manifest parse failed.

NEW_VERSION_FOUND 

New version found.

ALREADY_UP_TO_DATE 

Already up to date with the remote resources server.

UPDATE_PROGRESSION 

Update progression event.

ASSET_UPDATED 

One asset updated event.

ERROR_UPDATING 

Error during update process.

UPDATE_FINISHED 

Update finished event.

UPDATE_FAILED 

Update failed event.

ERROR_DECOMPRESS 

Failed to decompress a file event.

var EventCode
strong

Update events code.

Enumerator
ERROR_NO_LOCAL_MANIFEST 

Local manifest not found error.

ERROR_DOWNLOAD_MANIFEST 

Remote manifest download failed.

ERROR_PARSE_MANIFEST 

Manifest parse failed.

NEW_VERSION_FOUND 

New version found.

ALREADY_UP_TO_DATE 

Already up to date with the remote resources server.

UPDATE_PROGRESSION 

Update progression event.

ASSET_UPDATED 

One asset updated event.

ERROR_UPDATING 

Error during update process.

UPDATE_FINISHED 

Update finished event.

UPDATE_FAILED 

Update failed event.

ERROR_DECOMPRESS 

Failed to decompress a file event.

local EventCode
strong

Update events code.

Enumerator
ERROR_NO_LOCAL_MANIFEST 

Local manifest not found error.

ERROR_DOWNLOAD_MANIFEST 

Remote manifest download failed.

ERROR_PARSE_MANIFEST 

Manifest parse failed.

NEW_VERSION_FOUND 

New version found.

ALREADY_UP_TO_DATE 

Already up to date with the remote resources server.

UPDATE_PROGRESSION 

Update progression event.

ASSET_UPDATED 

One asset updated event.

ERROR_UPDATING 

Error during update process.

UPDATE_FINISHED 

Update finished event.

UPDATE_FAILED 

Update failed event.

ERROR_DECOMPRESS 

Failed to decompress a file event.

enum DiffType
strong

Type of difference between local and remote asset.

Enumerator
ADDED 

Added in remote, absent in local.

DELETED 

Deleted in remote, present in local.

MODIFIED 

Updated in remote, local version is old.

var DiffType
strong

Type of difference between local and remote asset.

Enumerator
ADDED 

Added in remote, absent in local.

DELETED 

Deleted in remote, present in local.

MODIFIED 

Updated in remote, local version is old.

local DiffType
strong

Type of difference between local and remote asset.

Enumerator
ADDED 

Added in remote, absent in local.

DELETED 

Deleted in remote, present in local.

MODIFIED 

Updated in remote, local version is old.

enum DownloadState
strong

Download state of a updating asset.

Enumerator
UNSTARTED 

Wait to be updated.

DOWNLOADING 

Downloading.

SUCCESSED 

Updated.

var DownloadState
strong

Download state of a updating asset.

Enumerator
UNSTARTED 

Wait to be updated.

DOWNLOADING 

Downloading.

SUCCESSED 

Updated.

local DownloadState
strong

Download state of a updating asset.

Enumerator
UNSTARTED 

Wait to be updated.

DOWNLOADING 

Downloading.

SUCCESSED 

Updated.