Scripting/Squirrel/Functions/Bounds: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
== Syntax ==
== Syntax ==


<pre>Bounds Bounds( maxX, minX, maxY, minY )</pre>
<pre>Bounds( MaxX, MinX, MaxY, MinY )</pre>


== Arguments ==
== Arguments ==


* '''maxX''' - The max X coordination of the boundary.
* '''MaxX''' - The max X coordination of the boundary.
* '''minX''' - The minimum X coordination of the boundary.
* '''MinX''' - The minimum X coordination of the boundary.
* '''maxY''' - The max Y coordination of the boundary.
* '''MaxY''' - The max Y coordination of the boundary.
* '''minY''' - The minimum Y coordination of the boundary.
* '''MinY''' - The minimum Y coordination of the boundary.


== Example ==
== Example ==
Line 18: Line 18:
{
{
local boundaries = GetWorldBounds();
local boundaries = GetWorldBounds();
print( "Worldboundaries has been set to :" + boundaries.maxX + "," + boundaries.minX + "," + boundaries.maxY + "," + boundaries.minY );
print( "Worldboundaries has been set to :" + boundaries.MaxX + "," + boundaries.MinX + "," + boundaries.MaxY + "," + boundaries.MinY );
}
}
</source>
</source>
Line 24: Line 24:
=== Notes ===
=== Notes ===


The function [[Scripting/Squirrel/Functions/GetWorldBounds|GetWorldBounds]] and call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
The function [[Scripting/Squirrel/Functions/GetWorldBounds|GetWorldBounds]] and call [[OnScriptLoad]] were used in this example. More info about them in the corresponding pages.


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/Data Structures}}
{{Scripting/Squirrel/Functions/Data Structures}}
[[Category:Scripting/Squirrel/Functions/Data_Structures]]

Latest revision as of 18:01, 30 January 2017

This Data type will hold world boundaries. You will get this Data Type when you use the GetWorldBounds function

Syntax

Bounds( MaxX, MinX, MaxY, MinY )

Arguments

  • MaxX - The max X coordination of the boundary.
  • MinX - The minimum X coordination of the boundary.
  • MaxY - The max Y coordination of the boundary.
  • MinY - The minimum Y coordination of the boundary.

Example

function onScriptLoad()
{
	local boundaries = GetWorldBounds();
	print( "Worldboundaries has been set to :" + boundaries.MaxX + "," + boundaries.MinX + "," + boundaries.MaxY + "," + boundaries.MinY );
}

Notes

The function GetWorldBounds and call OnScriptLoad were used in this example. More info about them in the corresponding pages.

Related Functions