Class Steppe.Renderer
Defined in: Renderer.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Steppe.Renderer(canvas)
|
Method Attributes | Method Name and Description |
---|---|
<static> |
Steppe.Renderer.addSprite(image, x, y, z)
Add a 2D sprite, at the specified world coords, to the sprite
list.
|
<static> |
Steppe.Renderer.disable(capability)
Disable a Steppe capability.
|
<static> |
Steppe.Renderer.enable(capability)
Enable a Steppe capability.
|
<static> |
Steppe.Renderer.getCamera()
Get the current camera.
|
<static> |
Steppe.Renderer.getHeight(x, z)
Get the height (from the heightmap) of a single unit of terrain,
in world space.
|
<static> |
Steppe.Renderer.isEnabled(capability)
Test whether a capability is enabled.
|
<static> |
Steppe.Renderer.render()
Render the terrain (landscape) including the sky and any visible
sprites.
|
<static> |
Steppe.Renderer.setCamera(camera)
Set the current camera.
|
<static> |
Steppe.Renderer.setFogColor(cssColor)
Set the fog colour.
|
<static> |
Steppe.Renderer.setHeightmap(heightmap)
Set the heightmap to use for terrain rendering.
|
<static> |
Steppe.Renderer.setOutOfBoundsHeightmap(outOfBoundsHeightmap)
Set the out-of-bounds heightmap.
|
<static> |
Steppe.Renderer.setOutOfBoundsTexturemap(outOfBoundsTexturemapCanvas)
Set the out-of-bounds texturemap.
|
<static> |
Steppe.Renderer.setQuality(quality)
Set render quality.
|
<static> |
Steppe.Renderer.setSky(skyCanvas)
Set the canvas to use for 360-degree panoramic sky.
|
<static> |
Steppe.Renderer.setTexturemap(texturemapCanvas)
Set the texturemap.
|
<static> |
Steppe.Renderer.setWaterHeight(height)
Set height of the reflection-mapped water.
|
Method Detail
<static>
{Renderer}
Steppe.Renderer.addSprite(image, x, y, z)
Add a 2D sprite, at the specified world coords, to the sprite
list.
- Parameters:
- {HTMLImageElement} image
- The 2D sprite as an image.
- {number} x
- The x-coordinate in world space.
- {number} y
- The y-coordinate in world space.
- {number} z
- The z-coordinate in world space.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.disable(capability)
Disable a Steppe capability.
- Parameters:
- {string} capability
- Specifies a string indicating a Steppe capability; 'fog', 'reflection-map' and 'smooth' are currently implemented.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.enable(capability)
Enable a Steppe capability.
- Parameters:
- {string} capability
- Specifies a string indicating a Steppe capability; 'fog', 'reflection-map' and 'smooth' are currently implemented.
- Returns:
- {Renderer} This (chainable).
<static>
{object}
Steppe.Renderer.getCamera()
Get the current camera.
- Returns:
- {object} An object composed of an angle-of-rotation (in degrees about the y-axis) and a 3D point in world space.
<static>
{number}
Steppe.Renderer.getHeight(x, z)
Get the height (from the heightmap) of a single unit of terrain,
in world space.
- Parameters:
- {number} x
- The x-coordinate of the unit of terrain.
- {number} z
- The z-coordinate of the unit of terrain.
- Returns:
- {number} The corresponding y-coordinate of the specified unit of terrain.
<static>
{boolean}
Steppe.Renderer.isEnabled(capability)
Test whether a capability is enabled.
- Parameters:
- {string} capability
- Specifies a string indicating a Steppe capability; 'smooth' and 'reflection-map' are currently implemented.
- Returns:
- {boolean} Returns true if capability is an enabled capability and returns false otherwise.
<static>
Steppe.Renderer.render()
Render the terrain (landscape) including the sky and any visible
sprites.
<static>
{Renderer}
Steppe.Renderer.setCamera(camera)
Set the current camera.
- Parameters:
- {object} camera
- The object representing the current camera.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setFogColor(cssColor)
Set the fog colour.
- Parameters:
- {string} cssColor
- ...
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setHeightmap(heightmap)
Set the heightmap to use for terrain rendering.
- Parameters:
- {array} heightmap
- The heightmap canvas as an array of values in the range 0..255.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setOutOfBoundsHeightmap(outOfBoundsHeightmap)
Set the out-of-bounds heightmap.
- Parameters:
- {array} outOfBoundsHeightmap
- The out-of-bounds heightmap canvas as an array.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setOutOfBoundsTexturemap(outOfBoundsTexturemapCanvas)
Set the out-of-bounds texturemap.
- Parameters:
- {HTMLCanvasElement} outOfBoundsTexturemapCanvas
- The out-of-bounds texturemap canvas.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setQuality(quality)
Set render quality.
- Parameters:
- {string} quality
- Specifies a string indicating the render quality from 'low', through 'medium', to 'high'.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setSky(skyCanvas)
Set the canvas to use for 360-degree panoramic sky.
- Parameters:
- {HTMLCanvasElement} skyCanvas
- The sky canvas; must be 1920x100.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setTexturemap(texturemapCanvas)
Set the texturemap.
- Parameters:
- {HTMLCanvasElement} texturemapCanvas
- The texturemap canvas.
- Returns:
- {Renderer} This (chainable).
<static>
{Renderer}
Steppe.Renderer.setWaterHeight(height)
Set height of the reflection-mapped water.
- Parameters:
- {number} height
- Globally-defined height of the reflection-mapped water. It must be in the range 0..255.
- Returns:
- {Renderer} This (chainable).