Class Light2D
Represents a 2D light element in the game.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class Light2D : GameElement
Constructors
Light2D(Vec3, Vec3)
Initializes a new instance of the Light2D class with the specified location and size.
Declaration
public Light2D(Vec3 location, Vec3 size)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | location | The location of the light. |
Vec3 | size | The size of the light. |
Light2D(string, Vec3, Vec3, Texture)
Initializes a new instance of the Light2D class with the specified name, location, size, and texture.
Declaration
public Light2D(string name, Vec3 location, Vec3 size, Texture texture)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the light. |
Vec3 | location | The location of the light. |
Vec3 | size | The size of the light. |
Texture | texture | The texture of the light. |
Properties
LightColor
Gets or sets the color of the light.
Declaration
public Color LightColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
LightShape
Gets or sets the shape of the light.
Declaration
public Texture LightShape { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Methods
GetColor()
Gets the color of the light.
Declaration
public Vec3 GetColor()
Returns
Type | Description |
---|---|
Vec3 | The color of the light as a vector. |
GetTexCoords()
Gets the texture coordinates for the light shape.
Declaration
public static float[] GetTexCoords()
Returns
Type | Description |
---|---|
float[] | An array of texture coordinates corresponding to the light shape. |
GetVericies()
Gets the vertices for the light shape.
Declaration
public static float[] GetVericies()
Returns
Type | Description |
---|---|
float[] | An array of vertices defining the shape of the light. |
Init(Game, IRenderDevice)
Initializes the light element.
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)
Destroys the light element.
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
Overrides
OnRender(Game, IRenderDevice)
Renders the light element.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device. |
Overrides
TestLight2D()
Tests the Light2D functionality.
Declaration
public void TestLight2D()