Class Scene2D
Represents a 2D scene in the game.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class Scene2D : Scene
Constructors
Scene2D()
Initializes a new instance of the Scene2D class.
Declaration
public Scene2D()
Scene2D(string)
Initializes a new instance of the Scene2D class.
Declaration
public Scene2D(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Properties
Framebuffer
Gets or sets the framebuffer used for rendering the lightmap.
Declaration
public Framebuffer Framebuffer { get; set; }
Property Value
Type | Description |
---|---|
Framebuffer |
LightmapIntensity
Gets or sets the intensity of the lightmap.
Declaration
public float LightmapIntensity { get; set; }
Property Value
Type | Description |
---|---|
float |
Lights
Gets the list of 2D lights in the scene.
Declaration
public List<Light2D> Lights { get; set; }
Property Value
Type | Description |
---|---|
List<Light2D> |
RenderLightmap
Gets or sets a value indicating whether to render the lightmap.
Declaration
public bool RenderLightmap { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddLight(Light2D)
Adds a 2D light to the scene.
Declaration
public void AddLight(Light2D light)
Parameters
Type | Name | Description |
---|---|---|
Light2D | light | The light to add. |
Init(Game, IRenderDevice)
Initializes the scene.
Declaration
public override void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device. |
Overrides
OnDestroy(Game)
Called when the scene is being destroyed.
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
Overrides
OnRender(Game, IRenderDevice)
Called when the scene needs to render.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device. |
Overrides
OnUpdate(Game, IRenderDevice)
Called when the scene needs to update.
Declaration
public override void OnUpdate(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device. |
Overrides
RemoveLight(Game, Light2D)
Removes a 2D light from the scene.
Declaration
public void RemoveLight(Game game, Light2D light)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
Light2D | light | The light to remove. |
Events
AfterLightmapRendering
Event that occurs after lightmap rendering.
Declaration
public event SceneEventHandler AfterLightmapRendering
Event Type
Type | Description |
---|---|
SceneEventHandler |
BeforeLightmapPreparation
Event that occurs before lightmap preparation.
Declaration
public event SceneEventHandler BeforeLightmapPreparation
Event Type
Type | Description |
---|---|
SceneEventHandler |