Difference between revisions of "Oolite JavaScript Reference: Planet"
(Added Oolite scripting category.) |
(→Properties) |
||
| Line 18: | Line 18: | ||
'''radius''' : Number (read-only) | '''radius''' : Number (read-only) | ||
The equatorial radius of the planet, in metres. | The equatorial radius of the planet, in metres. | ||
| + | |||
| + | == Methods == | ||
| + | |||
| + | === <code>setTexture</code> === | ||
| + | function '''setTexture'''(texture: String) | ||
| + | {{Oolite-method-added|1.71}} | ||
| + | |||
| + | Uses the texture file (must be a .png) as texture for the planet. This function only works when called during the shipWillExitWitchspace and shipWillLaunchFromStation events. | ||
[[Category:Oolite scripting]] | [[Category:Oolite scripting]] | ||
Revision as of 11:21, 11 May 2008
Prototype: Entity
Subtypes: none
This class was added in Oolite test release 1.70.
The Planet class is an Entity representing a planet or moon. A Planet has all the properties and methods of a Entity, and several others.
Properties
isMainPlanet
isMainPlanet : Boolean (read-only)
true if the entity is the main planet of the current system, false otherwise.
hasAtmosphere
hasAtmosphere : Boolean (read-only)
true if the entity has an atmosphere, false otherwise. Planets created with the System.addMoon() method (or corresponding legacy scripting method) have no atmosphere, other planets do.
radius
radius : Number (read-only)
The equatorial radius of the planet, in metres.
Methods
setTexture
function setTexture(texture: String)
This method was added in Oolite test release 1.71.
Uses the texture file (must be a .png) as texture for the planet. This function only works when called during the shipWillExitWitchspace and shipWillLaunchFromStation events.