TextItemSetScale: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function allows the setting of the scale of a text item. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool textItemSetScale ( textitem textitem, float scale ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''textitem:''' The text item you wish to set the scale of. | ||
*'''scale:''' A floating point value indicating the scale of the text you wish to set to. 1.0 is around 12pt. | |||
*''' | |||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if the scale was successfully set, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example | This example retreives the scale of the 'theTextitem' text item, and if it is too small it enlarges it so it is more visible. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | scale = textItemGetScale ( theTextitem ) --get the scale of theTextitem and define it as 'scale' | ||
if scale < 0.5 then --if the scale is smaller than 0.5 | |||
-- | textItemSetScale ( theTextitem, 1.0 ) --then restore it to default size, 1.0. | ||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Text functions}} |
Revision as of 16:59, 16 August 2006
This function allows the setting of the scale of a text item.
Syntax
bool textItemSetScale ( textitem textitem, float scale )
Required Arguments
- textitem: The text item you wish to set the scale of.
- scale: A floating point value indicating the scale of the text you wish to set to. 1.0 is around 12pt.
Returns
Returns true if the scale was successfully set, false otherwise.
Example
This example retreives the scale of the 'theTextitem' text item, and if it is too small it enlarges it so it is more visible.
scale = textItemGetScale ( theTextitem ) --get the scale of theTextitem and define it as 'scale' if scale < 0.5 then --if the scale is smaller than 0.5 textItemSetScale ( theTextitem, 1.0 ) --then restore it to default size, 1.0. end
See Also
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText