(info) Other great resources: Official JS API docs, Scripting Forum

centreView()

Centre the camera view on a specific x,y tile co-ordinate...

 

Syntax

centreView(x,y);

Parameters

ParameterTypeMandatoryDescriptionGame version
xNumber(tick)The x co-ordinate to show3.1 Beta 1
yNumber(tick)The y co-ordinate to show3.1 Beta 1

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe camera view has been updated3.1 Beta 1
<error>Error(question) I assume an error will be thrown if the x,y is out of bounds on the map?3.1 Beta 1

Example

Centre view on a new droid
eventDroidBuilt(droid) {
  centreView(droid.x, droid.y);
}
Availability 3.1 B1+

Requires:

  • Warzone 3.1 Beta 1 and above
Contents

Jump to:

See also

Related articles: