TextItemSetScale: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(Remove spaces)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Incomplete]]
__NOTOC__
 
{{Server function}}
__NOTOC__
This function allows the setting of the scale of a text item.
This fake function is for use with blah & blah and does blahblahblabhalbhl


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void textItemSetScale ( textitem textitem, float scale )            
bool textItemSetScale ( textitem theTextitem, float scale )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theTextitem:''' 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.
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if the scale was successfully set, ''false'' otherwise.


==Example==  
==Example==  
This example does...
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">
--This line does...
local scale = textItemGetScale ( theTextItem )  --get the scale of theTextitem and define it as 'scale'
blabhalbalhb --abababa
if (scale < 0.5) then --if the scale is smaller than 0.5
--This line does this...
textItemSetScale ( theTextItem, 1.0 ) --then restore it to default size, 1.0.
mooo
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{Text functions}}

Latest revision as of 21:13, 29 October 2023

This function allows the setting of the scale of a text item.

Syntax

bool textItemSetScale ( textitem theTextitem, float scale )

Required Arguments

  • theTextitem: 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 retrieves the scale of the theTextitem text item, and if it is too small it enlarges it so it is more visible.

local 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