Class Layer
Represents a layer containing game elements in the Genesis framework.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class Layer
Constructors
Layer()
Creates a new instance of the Layer class.
Declaration
public Layer()
Layer(string)
Creates a new instance of the Layer class with the specified name.
Declaration
public Layer(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the layer. |
Layer(string, bool)
Creates a new instance of the Layer class with the specified name and updateElements flag.
Declaration
public Layer(string name, bool updateElements)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the layer. |
bool | updateElements | Flag indicating whether the elements within the layer should be updated. |
Properties
Elements
Gets or sets the list of game elements within the layer.
Declaration
public List<GameElement> Elements { get; set; }
Property Value
Type | Description |
---|---|
List<GameElement> |
Name
Gets or sets the name of the layer.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
UpdateElements
Gets or sets a value indicating whether the elements within the layer should be updated.
Declaration
public bool UpdateElements { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
Init(Game, IRenderDevice)
Initializes all game elements within the layer.
Declaration
public void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The rendering device. |
OnDestroy(Game)
Destroys all game elements within the layer.
Declaration
public void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
OnRender(Game, IRenderDevice)
Renders all game elements within the layer.
Declaration
public void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The rendering device. |
OnUpdate(Game, IRenderDevice)
Updates all game elements within the layer if the UpdateElements flag is true.
Declaration
public void OnUpdate(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The rendering device. |