DxGetTextWidth: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 10: Line 10:
===Required Arguments===  
===Required Arguments===  
* '''text:''' A string representing the text for which you wish to retrieve with width for.
* '''text:''' A string representing the text for which you wish to retrieve with width for.
==Optional Arguments==
{{OptionalArg}}
* '''scale:''' The size of the text.
* '''scale:''' The size of the text.
* '''font:''' The dx font for the text.
* '''font:''' The dx font for the text.

Revision as of 19:16, 2 March 2008

This function retrieves the theoretical width of a certain piece of text, if it were to be drawn using dxDrawText.

Syntax

bool dxGetTextWidth ( string text, [float scale=1,string font="default"] )

Required Arguments

  • text: A string representing the text for which you wish to retrieve with width for.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • scale: The size of the text.
  • font: The dx font for the text.
    • "default": Tahoma
    • "default-bold": Tahoma Bold
    • "clear": Verdana
    • "arial": Arial
    • "sans": Microsoft Sans Serif
    • "pricedown": Pricedown (GTA's theme text)
    • "bankgothic": Bank Gothic Medium
    • "diploma": Diploma Regular
    • "beckett": Beckett Regular
    • "unifont": Unifont

Returns

Returns a true if the operation was successful, false otherwise.

Example

--TODO

See Also