indigo.shared.scenegraph
Type members
Classlikes
Ambient light isn't emitted from anywhere in particular, it is the base amount of illumination. It's important for a dark cave to light enough for your player to appreciate just how dark it really is.
Ambient light isn't emitted from anywhere in particular, it is the base amount of illumination. It's important for a dark cave to light enough for your player to appreciate just how dark it really is.
- Companion
- object
Blending instances tell Indigo how to blend the entities onto a layer, and then how to blend the layer onto the layers below it.
Blending instances tell Indigo how to blend the entities onto a layer, and then how to blend the layer onto the layers below it.
- Companion
- object
Parent type of camera instances. Cameras are used to look around your games graphics / levels / scenes.
Parent type of camera instances. Cameras are used to look around your games graphics / levels / scenes.
- Companion
- object
- Companion
- object
- Companion
- object
Represents many clones of the same clone blank, differentiated only by their transform data.
Represents many clones of the same clone blank, differentiated only by their transform data.
- Companion
- object
Represents the standard allowable transformations of a clone.
Represents the standard allowable transformations of a clone.
- Companion
- object
Used as the blueprint for any clones that want to copy it.
Used as the blueprint for any clones that want to copy it.
- Value Params
- cloneable
The primitive to clone, can be a Shape, Graphic or Sprite, or any custom entity that extends Cloneable
- id
The CloneId of this blank
- isStatic
Static clone blanks are only processed once and cached. This means that static sprites will never play their animations!
- Companion
- object
Represents the allowable transformations of a tile clone.
Represents the allowable transformations of a tile clone.
- Companion
- object
Represents many clones of the same cloneblank, differentiated by their transform data and which part of the texture it is cropped on.
Represents many clones of the same cloneblank, differentiated by their transform data and which part of the texture it is cropped on.
- Companion
- object
Used to distingush between cloneable and non-clonable scene graph nodes.
Used to distingush between cloneable and non-clonable scene graph nodes.
DependentNodes are built-in node types where Indigo understands how to build the shader data, and the bounds are dependant on the contents of the node.
DependentNodes are built-in node types where Indigo understands how to build the shader data, and the bounds are dependant on the contents of the node.
- Companion
- object
Direction lights apply light to a scene evenly from a particular direction, as if from a point a very long way away, e.g. the sun.
Direction lights apply light to a scene evenly from a particular direction, as if from a point a very long way away, e.g. the sun.
- Companion
- object
EntityNodes can be extended to create custom scene elements.
EntityNodes can be extended to create custom scene elements.
May be used in conjunction with EventHandler
and Cloneable
.
- Companion
- object
Represents different lighting falloff models, also known as attenuation, i.e. how much a light power decays over distance.
Represents different lighting falloff models, also known as attenuation, i.e. how much a light power decays over distance.
Quadratic is the most physically accurate, but possibly least useful for 2D games! All other models are unrealistic, but possibly easier to work with.
Note that "intensity" will feel different in different lighting models. Try smooth with intensity 1 or 2, Linear 5, or Quadratic 500 and compare.
- Companion
- object
Graphics are used to draw images on the screen, in a cheap efficient but expressive way. Graphics party trick is it's ability to crop images.
Graphics are used to draw images on the screen, in a cheap efficient but expressive way. Graphics party trick is it's ability to crop images.
- Companion
- object
Used to group elements to allow them to be manipulated as a collection.
Used to group elements to allow them to be manipulated as a collection.
- Companion
- object
A layers are used to stack collections screen elements on top of one another.
A layers are used to stack collections screen elements on top of one another.
During the scene render, each layer in depth order is blended into the one below it, a bit like doing a foldLeft over a list. You can control how the blend is performed to create effects.
Layer fields are all either Lists or options to denote that you can have them but that it isn't necessary. Layers are "monoids" which just means that they can be empty and they can be combined. It is important to note that when they combine they are left bias in the case of all optional fields, which means, that if you do: a.show |+| b.hide, the layer will be visible. This may look odd, and maybe it is (time will tell!), but the idea is that you can set empty placeholder layers early in your scene and then add things to them, confident of the outcome.
- Value Params
- blending
Optionally describes how to blend this layer onto the one below, by default, simply overlays on onto the other.
- camera
Optional camera specifically for this layer. If None, fallback to scene camera, or default camera.
- depth
Specifically set the depth, defaults to scene order.
- key
Optionally set a binding key, allows you to target specific layers when merging
SceneUpdateFragment
s.- lights
Layer level dynamic lights
- magnification
Optionally set the magnification, defaults to scene magnification.
- nodes
Nodes to render in this layer.
- visible
Optionally set the visiblity, defaults to visible
- Companion
- object
Represents many identical clones of the same clone blank, differentiated only by their shader data. Intended for use with custom entities in particular.
Represents many identical clones of the same clone blank, differentiated only by their shader data. Intended for use with custom entities in particular.
- Companion
- object
Scene audio can either be played on a loop, or be silenced.
Scene audio can either be played on a loop, or be silenced.
Point lights emit light evenly in all directions from a point in space.
Point lights emit light evenly in all directions from a point in space.
- Companion
- object
RenderNodes are built-in node types that have their own size, and where Indigo understands how to build the shader data.
RenderNodes are built-in node types that have their own size, and where Indigo understands how to build the shader data.
- Companion
- object
Describes what audio is currently being played by the scene as part of a SceneUpdateFragment
. Can play up to three audio sources at once.
Describes what audio is currently being played by the scene as part of a SceneUpdateFragment
. Can play up to three audio sources at once.
- Companion
- object
Represents a single audio source, how it is being played, and at what volume. You could implement a cross fade between two audio sources.
Represents a single audio source, how it is being played, and at what volume. You could implement a cross fade between two audio sources.
- Companion
- object
The internal parent type of anything that can affect the visual representation of the game.
The internal parent type of anything that can affect the visual representation of the game.
There are some SceneGraphNode's used only for internal scene processing.
- Companion
- object
The parent type of all nodes a user might use or create. Defines the fields needed to draw something onto the screen.
The parent type of all nodes a user might use or create. Defines the fields needed to draw something onto the screen.
- Companion
- object
A description of what the engine should next present to the player.
A description of what the engine should next present to the player.
SceneUpdateFragments are predicatably composable, so you can make a scene in pieces and then combine them all at the end.
Note that a SceneUpdateFragment represents what is to happen next. It is not a diff. If you remove a sprite from the definition it will not be drawn.
- Value Params
- audio
Background audio.
- blendMaterial
Optional blend material that describes how to render the scene to the screen.
- camera
Scene level camera enabling pan and zoom.
- cloneBlanks
A list of elements that will be referenced by clones in the main layers.
- layers
The layers game elements are placed on.
- lights
Dynamic lights.
- Companion
- object
Parent type for all Shapes, which are visible elements draw mathematically that require no textures. Shapes are quite versitile and support different fills and stroke effects, even lighting. Due to the way strokes around shapes are drawn, the corners are always rounded.
Parent type for all Shapes, which are visible elements draw mathematically that require no textures. Shapes are quite versitile and support different fills and stroke effects, even lighting. Due to the way strokes around shapes are drawn, the corners are always rounded.
- Companion
- object
Spot lights emit light like a lamp, they are essentially a point light, where the light is only allow to escape in a particular anglular range.
Spot lights emit light like a lamp, they are essentially a point light, where the light is only allow to escape in a particular anglular range.
- Companion
- object
Sprites are used to represented key-frame animated screen elements.
Sprites are used to represented key-frame animated screen elements.
- Companion
- object
Used to draw text onto the screen based on font sprite sheets (images / textures) and a character mapping instance
called FontInfo
. Text
instances are a bit of work to set up, but give super crisp pixel perfect results.
Used to draw text onto the screen based on font sprite sheets (images / textures) and a character mapping instance
called FontInfo
. Text
instances are a bit of work to set up, but give super crisp pixel perfect results.
- Companion
- object
Used to draw text on the screen quickly based on a font. Much quicker and eaiser to use that Text
, however suffers
from all the problems of browser rendered fonts, most notably, you cannot have pixel perfect fonts (fine for
mock-ups of HD UI layers perhaps).
Used to draw text on the screen quickly based on a font. Much quicker and eaiser to use that Text
, however suffers
from all the problems of browser rendered fonts, most notably, you cannot have pixel perfect fonts (fine for
mock-ups of HD UI layers perhaps).
- Companion
- object
Types
A CloneId is used to connect a Clone instance to a CloneBlank.
A CloneId is used to connect a Clone instance to a CloneBlank.
Zoom your camera in and out! Behaves like physical camera's zoom, so x2 means "make everything twice as big". Unlike a real camera, you can zoom in or our infinitely!
Zoom your camera in and out! Behaves like physical camera's zoom, so x2 means "make everything twice as big". Unlike a real camera, you can zoom in or our infinitely!