Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class Image

    UI element for displaying images/textures

    Inheritance
    object
    UIElementBase
    Image
    Implements
    IUIElement
    Inherited Members
    UIElementBase._children
    UIElementBase.Tooltip
    UIElementBase.TooltipLocalizationKey
    UIElementBase.TooltipFallbackText
    UIElementBase.Id
    UIElementBase.Position
    UIElementBase.Size
    UIElementBase.Visible
    UIElementBase.Opacity
    UIElementBase.Parent
    UIElementBase.Children
    UIElementBase.AddChild(IUIElement)
    UIElementBase.RemoveChild(IUIElement)
    UIElementBase.RemoveFromParent()
    UIElementBase.GetWorldPosition()
    UIElementBase.GetLocalPosition()
    UIElementBase.Update()
    UIElementBase.Draw()
    UIElementBase.SetTooltip(string)
    UIElementBase.SetTooltipLocalizationKey(string, string)
    UIElementBase.UpdateTooltipFromLocalization()
    UIElementBase.SetTooltipText(string)
    UIElementBase.SetLocalizationService(ILocalizationService)
    UIElementBase.IsMouseOver()
    UIElementBase.UpdateSelf()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: PopcorningGuineaPig.Engine.UI
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public class Image : UIElementBase, IUIElement

    Constructors

    | Edit this page View Source

    Image(Texture2D, Vector2, Vector2)

    Declaration
    public Image(Texture2D texture, Vector2 position, Vector2 size)
    Parameters
    Type Name Description
    Texture2D texture
    Vector2 position
    Vector2 size
    | Edit this page View Source

    Image(Vector2, Vector2)

    Declaration
    public Image(Vector2 position, Vector2 size)
    Parameters
    Type Name Description
    Vector2 position
    Vector2 size

    Properties

    | Edit this page View Source

    Stretch

    Declaration
    public bool Stretch { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Tint

    Declaration
    public Color Tint { get; set; }
    Property Value
    Type Description
    Color

    Methods

    | Edit this page View Source

    DrawSelf()

    Override to implement element-specific drawing logic

    Declaration
    protected override void DrawSelf()
    Overrides
    UIElementBase.DrawSelf()
    | Edit this page View Source

    SetSourceRect(Rectangle)

    Sets the source rectangle for texture sampling

    Declaration
    public void SetSourceRect(Rectangle rect)
    Parameters
    Type Name Description
    Rectangle rect

    The source rectangle

    | Edit this page View Source

    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

    | Edit this page View Source

    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

    | Edit this page View Source

    SetTint(Color)

    Sets the tint color for the image

    Declaration
    public void SetTint(Color color)
    Parameters
    Type Name Description
    Color color

    The tint color

    Implements

    IUIElement
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.