SetMarkerSize: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(13 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Needs_Checking|Will not accept varible for markersize arg. I wanted to make a gradually fading ball of light for an explosion.}}
__NOTOC__
{{Server client function}}
This function sets the size of the specified marker.


__NOTOC__
Setting negative value will "flip" the marker, do nothing or make it invisible:
This function sets the size of the specified marker. The function returns false if it fails.
* '''cylinder''' or '''arrow''': upside down
* '''ring''': inside out
* '''checkpoint''': disappear
* '''corona''': bigger


==Syntax==
==Syntax==
Line 8: Line 13:
bool setMarkerSize ( marker theMarker, float size )
bool setMarkerSize ( marker theMarker, float size )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[Marker]]:setSize|size|getMarkerSize}}
===Required Arguments===
*'''theMarker:''' The [[marker]] that you wish to set the size of.
*'''size:''' A float representing new size of the marker.


===Required Arguments===
===Returns===
*'''theMarker''': The [[marker]] that you wish to retrieve the size of.
Returns ''true'' if successful, ''false'' if failed.
*'''size''': The new size of the marker.
 
==Example 1==
This example creates a cylinder marker at the position 0, 0, 2 and sets its size to ''2.5''.
<syntaxhighlight lang="lua">
local newMarker = createMarker ( 0, 0, 2, "cylinder", 1 )
setMarkerSize ( newMarker, 2.5 )
</syntaxhighlight>


==Example==
==Example 2==
This example creates a marker at the position 1000, 1000, 1000 and sets it's size to ''2.5''.
This example creates a cylinder marker at the position 0, 0, 2 and plus its size by ''1'' by using 'getMarkerSize'.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
newmarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 )
local newMarker = createMarker ( 0, 0, 2, "cylinder", 1 )
setMarkerSize ( newmarker, 2.5)
setMarkerSize ( newMarker, getMarkerSize( newMarker ) + 1 )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
===Client===
{{Client marker functions}}
===Server===
{{Marker functions}}
{{Marker functions}}

Latest revision as of 13:17, 10 October 2023

This function sets the size of the specified marker.

Setting negative value will "flip" the marker, do nothing or make it invisible:

  • cylinder or arrow: upside down
  • ring: inside out
  • checkpoint: disappear
  • corona: bigger

Syntax

bool setMarkerSize ( marker theMarker, float size )

OOP Syntax Help! I don't understand this!

Method: Marker:setSize(...)
Variable: .size
Counterpart: getMarkerSize


Required Arguments

  • theMarker: The marker that you wish to set the size of.
  • size: A float representing new size of the marker.

Returns

Returns true if successful, false if failed.

Example 1

This example creates a cylinder marker at the position 0, 0, 2 and sets its size to 2.5.

local newMarker = createMarker ( 0, 0, 2, "cylinder", 1 )
setMarkerSize ( newMarker, 2.5 )

Example 2

This example creates a cylinder marker at the position 0, 0, 2 and plus its size by 1 by using 'getMarkerSize'.

local newMarker = createMarker ( 0, 0, 2, "cylinder", 1 )
setMarkerSize ( newMarker, getMarkerSize( newMarker ) + 1 )

See Also

Client



Server