TextItemGetScale: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theTextitem:''' The text item you wish to | *'''theTextitem:''' The text item you wish to retrieve the scale of | ||
===Returns=== | ===Returns=== | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example | This example retrieves 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 | scale = textItemGetScale ( theTextitem ) -- get the scale of theTextItem and store it in the 'scale' variable | ||
if scale < 0.5 then --if the scale is smaller than 0.5 | if scale < 0.5 then -- if the scale is smaller than 0.5 | ||
textItemSetScale ( | textItemSetScale ( theTextItem, 1.0 ) -- then restore it to default size, 1.0. | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 18:29, 21 August 2007
This function allows retrieval of the scale or size of a text item.
Syntax
float textItemGetScale ( textitem theTextitem )
Required Arguments
- theTextitem: The text item you wish to retrieve the scale of
Returns
Returns a floating point of the scale of the text. 1.0 is around 12pt.
Example
This example retrieves 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 store it in the 'scale' variable 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