FUIButton
extends FUIView
in package
Table of Contents
Constants
- BUTTON_PRESS_ENDED = 2
- BUTTON_PRESS_NONE = 0
- BUTTON_PRESS_STARTED = 1
Properties
- $buttonId : string
- Button ID
- $children : array<string|int, FUIView>
- An array of child views
- $fullWidth : bool
- If set to true, the button will take the full width of the parent container instead of basing its size on the text width
- $onClick : Closure|null
- $padding : Vec4
- Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
- $style : FUIButtonStyle
- The style of the button
- $text : string
Methods
- __construct() : mixed
- Constructs a new view
- applyStyle() : self
- Applies the given button style
- getEstimatedSize() : Vec2
- Returns the estimated size of the button
- padding() : self
- Sets the views padding Padding is the space inside the view to its content
- paddingAll() : self
- Sets all padding values to the same value Padding is the space inside the view to its content
- paddingBottom() : self
- Sets the views bottom padding Padding is the space inside the view to its content
- paddingFull() : self
- Sets the views padding with individual values Padding is the space inside the view to its content
- paddingLeft() : self
- Sets the views left padding Padding is the space inside the view to its content
- paddingRight() : self
- Sets the views right padding Padding is the space inside the view to its content
- paddingTop() : self
- Sets the views top padding Padding is the space inside the view to its content
- paddingX() : self
- Sets the views horizontal padding (left and right) Padding is the space inside the view to its content
- paddingY() : self
- Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content
- render() : void
- Renders the current view using the provided context
- setFullWidth() : self
- Sets the button to full width mode
- setId() : self
- Sets the button ID
Constants
BUTTON_PRESS_ENDED
private
mixed
BUTTON_PRESS_ENDED
= 2
BUTTON_PRESS_NONE
private
mixed
BUTTON_PRESS_NONE
= 0
BUTTON_PRESS_STARTED
private
mixed
BUTTON_PRESS_STARTED
= 1
Properties
$buttonId
Button ID
public
string
$buttonId
$children
An array of child views
public
array<string|int, FUIView>
$children
= []
$fullWidth
If set to true, the button will take the full width of the parent container instead of basing its size on the text width
public
bool
$fullWidth
= false
$onClick
public
Closure|null
$onClick
= null
$padding
Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
public
Vec4
$padding
$style
The style of the button
public
FUIButtonStyle
$style
$text
public
string
$text
Methods
__construct()
Constructs a new view
public
__construct(string $text[, Closure|null $onClick = null ][, string|null $buttonId = null ][, FUIButtonStyle|null $buttonStyle = null ]) : mixed
Parameters
- $text : string
- $onClick : Closure|null = null
- $buttonId : string|null = null
- $buttonStyle : FUIButtonStyle|null = null
applyStyle()
Applies the given button style
public
applyStyle(FUIButtonStyle $style) : self
Parameters
- $style : FUIButtonStyle
Return values
selfgetEstimatedSize()
Returns the estimated size of the button
public
getEstimatedSize(FUIRenderContext $ctx) : Vec2
Parameters
- $ctx : FUIRenderContext
Return values
Vec2padding()
Sets the views padding Padding is the space inside the view to its content
public
padding(float $horizontal, float $vertical) : self
Parameters
- $horizontal : float
- $vertical : float
Return values
selfpaddingAll()
Sets all padding values to the same value Padding is the space inside the view to its content
public
paddingAll(float $padding) : self
Parameters
- $padding : float
Return values
selfpaddingBottom()
Sets the views bottom padding Padding is the space inside the view to its content
public
paddingBottom(float $paddingBottom) : self
Parameters
- $paddingBottom : float
Return values
selfpaddingFull()
Sets the views padding with individual values Padding is the space inside the view to its content
public
paddingFull(float $left, float $right, float $top, float $bottom) : self
Parameters
- $left : float
- $right : float
- $top : float
- $bottom : float
Return values
selfpaddingLeft()
Sets the views left padding Padding is the space inside the view to its content
public
paddingLeft(float $paddingLeft) : self
Parameters
- $paddingLeft : float
Return values
selfpaddingRight()
Sets the views right padding Padding is the space inside the view to its content
public
paddingRight(float $paddingRight) : self
Parameters
- $paddingRight : float
Return values
selfpaddingTop()
Sets the views top padding Padding is the space inside the view to its content
public
paddingTop(float $paddingTop) : self
Parameters
- $paddingTop : float
Return values
selfpaddingX()
Sets the views horizontal padding (left and right) Padding is the space inside the view to its content
public
paddingX(float $paddingX) : self
Parameters
- $paddingX : float
Return values
selfpaddingY()
Sets the views vertical padding (top and bottom) Padding is the space inside the view to its content
public
paddingY(float $paddingY) : self
Parameters
- $paddingY : float
Return values
selfrender()
Renders the current view using the provided context
public
render(FUIRenderContext $ctx) : void
Parameters
- $ctx : FUIRenderContext
setFullWidth()
Sets the button to full width mode
public
setFullWidth([bool $fullWidth = true ]) : self
Parameters
- $fullWidth : bool = true
Return values
selfsetId()
Sets the button ID
public
setId(string $id) : self
Parameters
- $id : string