Class ShipCompass

Compass for general shipboard use.

Packaged up all nice and pretty. I think so, anyway.

Public methods

ShipCompass:new (_instanceName, _x, _y) Creates a new instance of the ShipCompass class and its display

Private methods

ShipCompass:setCourseNeedle (_direction) Sets the orientation of the course needle.
ShipCompass:setWindNeedle (_direction) Sets the orientation of the wind needle.
ShipCompass:setBearingNeedle (_direction) Sets the orientation of the bearing needle.
ShipCompass:move (to_X, to_Y) Sets the orientation of the bearing needle.
ShipCompass:update (Takes) Updates needles.


Public methods

For creating and Initialising ShipCompass object.
ShipCompass:new (_instanceName, _x, _y) line 21
Creates a new instance of the ShipCompass class and its display

Parameters:

  • _instanceName string Name for the consoles and such. Should be identical to object's unique name.
  • _x int X screen coordinate of ShipCompass's top-left point.
  • _y int Y screen coordinate of ShipCompass's top-left point.

Returns:

    table A new instance of the ShipCompass class.

Usage:

    compass = ShipCompass:new("compass",14,587)

Private methods

Privatise these, you silly bird.
ShipCompass:setCourseNeedle (_direction) line 83
Sets the orientation of the course needle.

Parameters:

  • _direction string Direction in short format.

Usage:

    compass:setCourseNeedle("nw")
ShipCompass:setWindNeedle (_direction) line 100
Sets the orientation of the wind needle.

Parameters:

  • _direction string Direction in short format.

Usage:

    compass:setWindNeedle("ne")
ShipCompass:setBearingNeedle (_direction) line 119
Sets the orientation of the bearing needle.

Parameters:

  • _direction int Direction in rounded degrees.

Usage:

    compass:setBearingNeedle(270)
ShipCompass:move (to_X, to_Y) line 139
Sets the orientation of the bearing needle.

Parameters:

  • to_X int X coordinate to move top-left point of container to, in screen coordinates.
  • to_Y int Y coordinate to move top-left point of container to, in screen coordinates.

Usage:

    compass:move(273,270)
ShipCompass:update (Takes) line 152
Updates needles. Has event handler to handle it trigger-free. Ship:processPrompt

Parameters:

  • Takes args in prompt data from event handler.
generated by LDoc 1.4.3 Last updated 2021-01-24 20:08:44