cocos2d-x  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FontAtlas Class Reference

#include <CCFontAtlas.h>

Inheritance diagram for FontAtlas:
Ref

Public Member Functions

 FontAtlas (Font &theFont)
 ctor ( var theFont)
 FontAtlas ( local theFont)
virtual ~FontAtlas ()
void addLetterDefinition (const FontLetterDefinition &letterDefinition)
var addLetterDefinition ( var letterDefinition)
local addLetterDefinition ( local letterDefinition)
bool getLetterDefinitionForChar (char16_t letteCharUTF16, FontLetterDefinition &outDefinition)
var getLetterDefinitionForChar ( var letteCharUTF16, var outDefinition)
local getLetterDefinitionForChar ( local letteCharUTF16, local outDefinition)
bool prepareLetterDefinitions (const std::u16string &utf16String)
const std::unordered_map
< ssize_t, Texture2D * > & 
getTextures () const
local getTextures ()
void addTexture (Texture2D *texture, int slot)
var addTexture ( var texture, var slot)
local addTexture ( local texture, local slot)
float getCommonLineHeight () const
var getCommonLineHeight ()
local getCommonLineHeight ()
void setCommonLineHeight (float newHeight)
var setCommonLineHeight ( var newHeight)
local setCommonLineHeight ( local newHeight)
Texture2D * getTexture (int slot)
var getTexture ( var slot)
local getTexture ( local slot)
const Font * getFont () const
var getFont ()
local getFont ()
void listenRendererRecreated (EventCustom *event)
 listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8. More...
 
var listenRendererRecreated ( var event)
 listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8. More...
 
local listenRendererRecreated ( local event)
 listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8. More...
 
void purgeTexturesAtlas ()
 Removes textures atlas. More...
 
void setAntiAliasTexParameters ()
 sets font texture parameters: More...
 
void setAliasTexParameters ()
 sets font texture parameters: More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Ref * autorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Static Public Attributes

static const int CacheTextureWidth
var CacheTextureWidth
local CacheTextureWidth
static const int CacheTextureHeight
var CacheTextureHeight
local CacheTextureHeight
static const char * CMD_PURGE_FONTATLAS
var CMD_PURGE_FONTATLAS
local CMD_PURGE_FONTATLAS
static const char * CMD_RESET_FONTATLAS
var CMD_RESET_FONTATLAS
local CMD_RESET_FONTATLAS

Protected Member Functions

void relaseTextures ()
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

std::unordered_map< ssize_t,
Texture2D * > 
_atlasTextures
std::unordered_map< unsigned
short, FontLetterDefinition > 
_fontLetterDefinitions
float _commonLineHeight
Font * _font
var _font
local _font
int _currentPage
var _currentPage
local _currentPage
unsigned char * _currentPageData
var _currentPageData
local _currentPageData
int _currentPageDataSize
var _currentPageDataSize
local _currentPageDataSize
float _currentPageOrigX
var _currentPageOrigX
local _currentPageOrigX
float _currentPageOrigY
var _currentPageOrigY
local _currentPageOrigY
float _letterPadding
var _letterPadding
local _letterPadding
int _fontAscender
var _fontAscender
local _fontAscender
EventListenerCustom * _rendererRecreatedListener
var _rendererRecreatedListener
local _rendererRecreatedListener
bool _antialiasEnabled
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
var _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Constructor & Destructor Documentation

FontAtlas ( Font &  theFont)
var ctor ( var  theFont)
local FontAtlas ( local  theFont)
virtual ~FontAtlas ( )
virtual

Member Function Documentation

void addLetterDefinition ( const FontLetterDefinition &  letterDefinition)
var addLetterDefinition ( var  letterDefinition)
local addLetterDefinition ( local  letterDefinition)
void addTexture ( Texture2D *  texture,
int  slot 
)
var addTexture ( var  texture,
var  slot 
)
local addTexture ( local  texture,
local  slot 
)
float getCommonLineHeight ( ) const
var getCommonLineHeight ( )
local getCommonLineHeight ( )
const Font* getFont ( ) const
var getFont ( )
local getFont ( )
bool getLetterDefinitionForChar ( char16_t  letteCharUTF16,
FontLetterDefinition &  outDefinition 
)
var getLetterDefinitionForChar ( var  letteCharUTF16,
var  outDefinition 
)
local getLetterDefinitionForChar ( local  letteCharUTF16,
local  outDefinition 
)
Texture2D* getTexture ( int  slot)
var getTexture ( var  slot)
local getTexture ( local  slot)
const std::unordered_map
<ssize_t, Texture2D*>
& getTextures
( ) const
inline
var getTextures ( )
inline
local getTextures ( )
inline
void listenRendererRecreated ( EventCustom *  event)

listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8.

var listenRendererRecreated ( var  event)

listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8.

local listenRendererRecreated ( local  event)

listen the event that renderer was recreated on Android/WP8 It only has effect on Android and WP8.

bool prepareLetterDefinitions ( const std::u16string &  utf16String)
var prepareLetterDefinitions ( var  utf16String)
local prepareLetterDefinitions ( local  utf16String)
void purgeTexturesAtlas ( )

Removes textures atlas.

It will purge the textures atlas and if multiple texture exist in the FontAtlas.

var purgeTexturesAtlas ( )

Removes textures atlas.

It will purge the textures atlas and if multiple texture exist in the FontAtlas.

local purgeTexturesAtlas ( )

Removes textures atlas.

It will purge the textures atlas and if multiple texture exist in the FontAtlas.

void relaseTextures ( )
protected
var relaseTextures ( )
protected
local relaseTextures ( )
protected
void setAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_NEAREST
  • GL_TEXTURE_MAG_FILTER = GL_NEAREST
var setAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_NEAREST
  • GL_TEXTURE_MAG_FILTER = GL_NEAREST
local setAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_NEAREST
  • GL_TEXTURE_MAG_FILTER = GL_NEAREST
void setAntiAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_LINEAR
  • GL_TEXTURE_MAG_FILTER = GL_LINEAR
var setAntiAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_LINEAR
  • GL_TEXTURE_MAG_FILTER = GL_LINEAR
local setAntiAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_LINEAR
  • GL_TEXTURE_MAG_FILTER = GL_LINEAR
void setCommonLineHeight ( float  newHeight)
var setCommonLineHeight ( var  newHeight)
local setCommonLineHeight ( local  newHeight)

Member Data Documentation

bool _antialiasEnabled
protected
var _antialiasEnabled
protected
local _antialiasEnabled
protected
std::unordered_map<ssize_t,
Texture2D*> _atlasTextures
protected
var _atlasTextures
protected
local _atlasTextures
protected
float _commonLineHeight
protected
var _commonLineHeight
protected
local _commonLineHeight
protected
int _currentPage
protected
var _currentPage
protected
local _currentPage
protected
unsigned char* _currentPageData
protected
var _currentPageData
protected
local _currentPageData
protected
int _currentPageDataSize
protected
var _currentPageDataSize
protected
local _currentPageDataSize
protected
float _currentPageOrigX
protected
var _currentPageOrigX
protected
local _currentPageOrigX
protected
float _currentPageOrigY
protected
var _currentPageOrigY
protected
local _currentPageOrigY
protected
Font* _font
protected
var _font
protected
local _font
protected
int _fontAscender
protected
var _fontAscender
protected
local _fontAscender
protected
std::unordered_map<unsigned
short, FontLetterDefinition>
_fontLetterDefinitions
protected
var _fontLetterDefinitions
protected
local _fontLetterDefinitions
protected
float _letterPadding
protected
var _letterPadding
protected
local _letterPadding
protected
EventListenerCustom*
_rendererRecreatedListener
protected
var _rendererRecreatedListener
protected
local _rendererRecreatedListener
protected
const int CacheTextureHeight
static
var CacheTextureHeight
static
local CacheTextureHeight
static
const int CacheTextureWidth
static
var CacheTextureWidth
static
local CacheTextureWidth
static
const char* CMD_PURGE_FONTATLAS
static
var CMD_PURGE_FONTATLAS
static
local CMD_PURGE_FONTATLAS
static
const char* CMD_RESET_FONTATLAS
static
var CMD_RESET_FONTATLAS
static
local CMD_RESET_FONTATLAS
static

The documentation for this class was generated from the following file: