class openfl.gui.Button extends Control

Available on all platforms

Instance Fields

var autoSize:Bool

Gets or sets whether or not the button will automatically size based on the bounds of the inner text. If an icon exists, autoSize is ignored.

var boundingHeight:Float

Gets or sets the height of the button. This will redraw the bounds of the button. This is automatically set if autoSize is on.

var boundingWidth:Float

Gets or sets the width of the button. This will redraw the bounds of the button. This is automatically set if autoSize is on.

var iconLocation:String

Gets or sets the path of the icon to show. If this is empty, or the path is invalid, no icon will be displayed.

var imageAlign:String

Gets or sets the alignment of the icon, if any. Valid values are: "left", "right", "top", "bottom". The bounds of the button will resize to match that of the image and text.

var text:String

Gets or sets the text value of the Button.

function new(value:String, ?font:String = 'Arial', ?fontStyle:FontStyle = null, ?embedded:Bool = false):Void

A button containing text and separate visual states for mouse interactivity.

function onStyleChanged(style:Style):Void