Class Panel
Represents a UI panel that can have a background image, background color, or both.
Inherited Members
Namespace: Genesis.UI
Assembly: Genesis.dll
Syntax
public class Panel : Widget
Constructors
Panel(string, Vec3, Vec3)
Initializes a new instance of the Panel class with the specified name, location, and size.
Declaration
public Panel(string name, Vec3 location, Vec3 size)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the panel. |
Vec3 | location | The location of the panel. |
Vec3 | size | The size of the panel. |
Properties
BackgroundColor
Gets or sets the background color of the panel.
Declaration
public Color BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
BackgroundImage
Gets or sets the background image of the panel.
Declaration
public Texture BackgroundImage { get; set; }
Property Value
Type | Description |
---|---|
Texture |
HasBackgroundColor
Gets or sets a value indicating whether the panel has a background color.
Declaration
public bool HasBackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
OnRender(Game, IRenderDevice, Scene, Canvas)
Renders the panel, considering the background image and color.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice, Scene scene, Canvas canvas)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The game instance. |
IRenderDevice | renderDevice | The render device used for rendering. |
Scene | scene | The scene in which the panel is rendered. |
Canvas | canvas | The canvas to which the panel belongs. |