Class Image
UI element for displaying images/textures
Implements
Inherited Members
Namespace: PopcorningGuineaPig.Engine.UI
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class Image : UIElementBase, IUIElement
Constructors
| Edit this page View SourceImage(Texture2D, Vector2, Vector2)
Declaration
public Image(Texture2D texture, Vector2 position, Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | texture | |
| Vector2 | position | |
| Vector2 | size |
Image(Vector2, Vector2)
Declaration
public Image(Vector2 position, Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | |
| Vector2 | size |
Properties
| Edit this page View SourceStretch
Declaration
public bool Stretch { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Tint
Declaration
public Color Tint { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Methods
| Edit this page View SourceDrawSelf()
Override to implement element-specific drawing logic
Declaration
protected override void DrawSelf()
Overrides
| Edit this page View SourceSetSourceRect(Rectangle)
Sets the source rectangle for texture sampling
Declaration
public void SetSourceRect(Rectangle rect)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | rect | The source rectangle |
SetStretch(bool)
Sets whether the image should stretch to fill the element size
Declaration
public void SetStretch(bool shouldStretch)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | shouldStretch | True to stretch, false to maintain aspect ratio |
SetTexture(Texture2D)
Sets the texture for this image element
Declaration
public void SetTexture(Texture2D texture)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | texture | The texture to display |
SetTint(Color)
Sets the tint color for the image
Declaration
public void SetTint(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | The tint color |