Class ImageButton
Represents an image button widget in the UI.
Inherited Members
Namespace: Genesis.UI
Assembly: Genesis.dll
Syntax
public class ImageButton : Widget
Constructors
ImageButton(string, Vec3, Vec3, Texture, Texture)
Creates a new instance of the ImageButton class.
Declaration
public ImageButton(string name, Vec3 location, Vec3 size, Texture normalTexture, Texture hoverTexture)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the image button. |
Vec3 | location | The location of the image button. |
Vec3 | size | The size of the image button. |
Texture | normalTexture | The normal texture displayed when the button is not hovered. |
Texture | hoverTexture | The hover texture displayed when the button is hovered. |
Properties
HoverTexture
Gets or sets the hover texture displayed when the button is hovered.
Declaration
public Texture HoverTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
NormalTexture
Gets or sets the normal texture displayed when the button is not hovered.
Declaration
public Texture NormalTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture |
Methods
OnRender(Game, IRenderDevice, Scene, Canvas)
Renders the image button on the screen.
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. |
Scene | scene | The scene instance. |
Canvas | canvas | The canvas containing the image button. |