Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-15-2008, 05:18 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
getFontZoom();

Not really something fancy, but still quite useful - especially when dealing with getTextWidth()/getTextHeight().

PHP Code:
function getFontZoom() return int(profile.fontSize/16) @ "." @ ((profile.fontSize%16)/16).substring(2); 

Example:

PHP Code:
new GuiTextCtrl("MyGuiTextCtrl") {
  
useOwnProfile true;
  
profile.fontSize 31;
  
temp.size getFontZoom(profile.fontSize);
  
text "[" temp.size "]";
        
  
getTextWidth(temp.sizeprofile.fontFaceprofile.fontStyletext);
  
getTextHeight(temp.sizeprofile.fontFaceprofile.fontStyle);
}

function 
getFontZoom(size) return int(size/16) @ "." @ ((size%16)/16).substring(2); 
Work's pixel perfectly!
__________________
Follow my work on social media post-Graal:Updated august 2025.

Last edited by xXziroXx; 05-16-2008 at 03:22 AM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.