final case class Layer(nodes: Batch[SceneNode], lights: Batch[Light], key: Option[BindingKey], magnification: Option[Int], depth: Option[Depth], visible: Option[Boolean], blending: Option[Blending], camera: Option[Camera])

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 Batchs 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: |+| 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 parameters:

Optionally describes how to blend this layer onto the one below, by default, simply overlays on onto the other.


Optional camera specifically for this layer. If None, fallback to scene camera, or default camera.


Specifically set the depth, defaults to scene order.


Optionally set a binding key, allows you to target specific layers when merging SceneUpdateFragments.


Layer level dynamic lights


Optionally set the magnification, defaults to scene magnification.


Nodes to render in this layer.


Optionally set the visiblity, defaults to visible

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def ++(moreNodes: Batch[SceneNode]): Layer
def addLights(newLights: Light*): Layer
def addLights(newLights: Batch[Light]): Layer
def addNodes(moreNodes: Batch[SceneNode]): Layer
def addNodes(moreNodes: SceneNode*): Layer
def combine(other: Layer): Layer
def hide: Layer
def modifyCamera(modifier: Camera => Camera): Layer
def show: Layer
def withBlendMaterial(newBlendMaterial: BlendMaterial): Layer
def withBlending(newBlending: Blending): Layer
def withCamera(newCamera: Camera): Layer
def withDepth(newDepth: Depth): Layer
def withEntityBlend(newBlend: Blend): Layer
def withKey(newKey: BindingKey): Layer
def withLayerBlend(newBlend: Blend): Layer
def withLights(newLights: Light*): Layer
def withLights(newLights: Batch[Light]): Layer
def withNodes(newNodes: Batch[SceneNode]): Layer
def withNodes(newNodes: SceneNode*): Layer
def withVisibility(isVisible: Boolean): Layer
def |+|(other: Layer): Layer

Inherited methods

Inherited from: