setTokenSnapToGrid: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page setTokenSnapToGrid to SetTokenSnapToGrid without leaving a redirect: Converting page title to first-letter uppercase)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setTokenSnapToGrid(snap)
setTokenSnapToGrid(snap)
setTokenSnapToGrid(snap, id)
setTokenSnapToGrid(snap, id)
setTokenSnapToGrid(snap, id, mapname)
setTokenSnapToGrid(snap, id, mapname)
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 19: Line 19:


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: setTokenSnapToGrid(0)]
[h: setTokenSnapToGrid(0)]
[h: setTokenSnapToGrid(1, currentToken())]</source>
[h: setTokenSnapToGrid(1, currentToken())]</syntaxhighlight>


|changes=
|changes=

Latest revision as of 17:48, 14 March 2023

setTokenSnapToGrid() Function

Introduced in version 1.4
Sets the "snap to" behaviour for the Current Token or a specified token.

Usage

setTokenSnapToGrid(snap)
setTokenSnapToGrid(snap, id)
setTokenSnapToGrid(snap, id, mapname)

Parameters

  • snap - A value true(1) or false(0).
  • id - The id of the token to set its snap behaviour.
  • mapname - The name of the map to find the token. Defaults to the current map.

Example

[h: setTokenSnapToGrid(0)]
[h: setTokenSnapToGrid(1, currentToken())]

See Also

Version Changes

  • 1.5.4 - Added mapname parameter option.