Class Image
The basic GUI image control. Shows texture, sprite or render target.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class Image : ContainerControl, IComparable, IDrawable
Constructors
Image()
Declaration
public Image()
Image(Float2, Float2)
Initializes a new instance of the ContainerControl class.
Declaration
public Image(Float2 location, Float2 size)
Parameters
Float2
location
|
Float2
size
|
Image(Rectangle)
Image(Single, Single, Single, Single)
Initializes a new instance of the ContainerControl class.
Declaration
public Image(float x, float y, float width, float height)
Parameters
System.Single
x
|
System.Single
y
|
System.Single
width
|
System.Single
height
|
Properties
Brush
Gets or sets the image source.
Declaration
[EditorOrder(10)]
[Tooltip("The image to draw.")]
public IBrush Brush { get; set; }
Property Value
IBrush
|
Color
Gets or sets the color used to multiply the image pixels.
Declaration
[EditorDisplay("Image Style", null)]
[EditorOrder(2010)]
[ExpandGroups]
public Color Color { get; set; }
Property Value
Color
|
DisabledTint
Gets or sets the color used to multiply the image pixels when control is disabled.
Declaration
[EditorDisplay("Image Style", null)]
[EditorOrder(2012)]
public Color DisabledTint { get; set; }
Property Value
Color
|
KeepAspectRatio
Gets or sets a value indicating whether keep aspect ratio when drawing the image.
Declaration
[EditorOrder(60)]
[Tooltip("If checked, control will keep aspect ratio of the image.")]
public bool KeepAspectRatio { get; set; }
Property Value
System.Boolean
|
Margin
Gets or sets the margin for the image.
Declaration
[EditorOrder(20)]
[Tooltip("Margins of the image area.")]
public Margin Margin { get; set; }
Property Value
Margin
|
MouseOverColor
Gets or sets the color used to multiply the image pixels when mouse is over the image.
Declaration
[EditorDisplay("Image Style", null)]
[EditorOrder(2011)]
public Color MouseOverColor { get; set; }
Property Value
Color
|
Methods
DrawSelf()
Draws the control.
Declaration
public override void DrawSelf()
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnSubmit()
Generic user interaction event for a control used by UI navigation (eg. user submits on the currently focused control).
Declaration
public override void OnSubmit()
Overrides
Events
Clicked
Occurs when mouse clicks on the image.
Declaration
public event Action<Image, MouseButton> Clicked
Event Type
System.Action<Image, MouseButton>
|