VISU - PHP Game Framework

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

$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

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

padding()

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
self

paddingAll()

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
self

paddingBottom()

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
self

paddingFull()

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
self

paddingLeft()

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
self

paddingRight()

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
self

paddingTop()

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
self

paddingX()

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
self

paddingY()

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
self

setFullWidth()

Sets the button to full width mode

public setFullWidth([bool $fullWidth = true ]) : self
Parameters
$fullWidth : bool = true
Return values
self

setId()

Sets the button ID

public setId(string $id) : self
Parameters
$id : string
Return values
self

        
On this page

Search results