Exemplo n.º 1
0
 unsigned short BitmapFont::GetAdvanceXForCharacter(char aCharacter)
 {
     CharacterData* characterData = m_CharacterData[aCharacter];
     if(characterData != nullptr)
     {
         return characterData->GetAdvanceX();
     }
     return 0;
 }
Exemplo n.º 2
0
 void BitmapFont::ParseCharactersNode(xml_node<> *aCharactersNode)
 {
     //Cycle through the characters and add them to the character map
     for (xml_node<> *character = aCharactersNode->first_node(); character; character = character->next_sibling())
     {
         //Create a new character data object
         CharacterData* characterData = new CharacterData();
         
         //Parse the character
         char characterId = characterData->ParseCharacterNode(character, this);
         
         #if LOG_BITMAP_FONT_GLYPH_DATA
         Log("Character Data for Character: %c - width: %f - height: %f - bearingX: %f - bearingY: %f - advance: %u", characterId, characterData->GetSourceFrame().size.x, characterData->GetSourceFrame().size.y, characterData->GetOffset().x, characterData->GetOffset().y, characterData->GetAdvanceX());
         #endif
         
         //Push back the character onto the character set vector
         m_CharacterSet.push_back(characterId);
         
         //Set the character data
         m_CharacterData[characterId] = characterData;
     }
 }