It is currently Fri Jun 23, 2017 10:35 am

All times are UTC - 5 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Ghost VMK 6 - Managing GUI Text
PostPosted: Wed Aug 20, 2008 7:56 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
In VMK 6A I add a few new functions to the GUI Manager so that I can use GUI Text objects once again with the game engine.

In VMK6B updates to the GUI Text class are made so that it will now work properly with the GUI Manager. The Vertex2 class is also updated to allow for Vertex2 * float operations to be evaluated.


Offline
 Profile  
 
 Post subject:
PostPosted: Tue Aug 26, 2008 7:48 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
I don't know what I was thinking when I updated the GUIText class. Instead of adding float m_fScaleFactor; to the GUIText class, take it out and use the scaling factor inside the Font class like this:

void GUIText::setTextScale(float fScaleFactor) {
   s_pTextureManager->setFontScale( m_fontID, fScaleFactor );
} //setTextScale


void GUIText::setText(const char *szText) {   
   [everything up here, same as before]

   //set the size of the text area
   m_v2Size = s_pTextureManager->getTextSize( m_fontID, m_szTextOutput );   

   //don't multiply by scaling factor here
   
   m_v2HotSize = m_v2Size;

}// setText


and in the Font class:
Vertex2 Font::getTextSize(const char *szText) {
   [everything up here, same as before]

   return v2Size * m_fScaleFactor; //multiply by scaling factor
} //GetTextSize


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron