Scenes Documentation Beta

Class Renderable​Entity​Container

open class RenderableEntityContainer : ContainableRenderableEntity 

A RenderableEntityContainer is used for containing zero or more ContainableRenderableEntitys. Because the container itself is a ContainableRenderableEntity, building a hierarchy of such containers is possible.

%77 RenderableEntityContainer RenderableEntityContainer ContainableRenderableEntity ContainableRenderableEntity RenderableEntityContainer->ContainableRenderableEntity

Superclass

ContainableRenderableEntity

A ContainableRenderableEntity is used for subclassing entities which may be contained in a RenderableEntityContainer. Descendant classes must:

Initializers

init(name:​top​Left:​fixed​Size:​)

public override init(name:String?=nil,
                         topLeft:Point=Point.zero, fixedSize:Size?) 

Properties

children

public private(set) var children : [ContainableRenderableEntity]

child​Rects

public var childRects : [Rect]? 

Provides or sets the childRect for all children In order to get, all children must have a currentCalculatedSize, otherwise nil is returned. In order to set, the count of childRects must exactly match the count of children, The childRects are applied in order. NB: A get reads the currentCaclulcatedSize, a set writes the externalSize

Methods

insert(owning​Layer:​entity:​)

public func insert(owningLayer:Layer, entity:ContainableRenderableEntity) 

Inserts the specified ContainableRenderableEntity into this container AND into the specified Layer immediately above this container. The entity's owningContainer is set to this container. The entity is repositioned relative to this container

recalculate​Size()

open func recalculateSize() 

This method is invoked when all children have either calculated their size This container should then query the children and determine the size of itself. It may also optionally resize the children (setting their specifiedSize) and/or reposition them (setting their topLeft). In the case where this container relies on information which is not yet available, it's OK to simply set a flag and complete the calculation later in the calculate() method.