Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   getFontZoom(); (https://forums.graalonline.com/forums/showthread.php?t=79740)

xXziroXx 05-15-2008 05:18 PM

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! :)

Tigairius 05-15-2008 05:40 PM

Oh, neat! I thought this was going to be a feature request :p


All times are GMT +2. The time now is 04:47 PM.

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