VISU - PHP Game Framework

FUIButtonGroup extends FUIView
in package

Table of Contents

Properties

$buttonGroupId  : string
Button group ID
$children  : array<string|int, FUIView>
An array of child views
$label  : string|null
A Label string that will be rendered before the button group
$onSelect  : Closure|null
$options  : array<string, string>
$padding  : Vec4
Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding
$selectedOption  : string|null
The currently selected option key
$style  : FUIButtonGroupStyle
The style of the button group
$selectedOptionRef  : string|null
Reference to external selected option variable (if provided)

Methods

__construct()  : mixed
Constructs a new button group
applyStyle()  : self
Applies the given button group style
getEstimatedSize()  : Vec2
Returns the estimated size of the button group
getSelectedOption()  : string|null
Gets the selected option
hideLabel()  : self
Hides the label for the button group
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 button group
setId()  : self
Sets the button group ID
setSelectedOption()  : self
Sets the selected option

Properties

$children

An array of child views

public array<string|int, FUIView> $children = []

$label

A Label string that will be rendered before the button group

public string|null $label = null

$options

public array<string, string> $options

Array of key => label pairs

$padding

Padding is represented as a Vec4 x = left padding y = right padding z = top padding w = bottom padding

public Vec4 $padding

$selectedOption

The currently selected option key

public string|null $selectedOption = null

$selectedOptionRef

Reference to external selected option variable (if provided)

private string|null $selectedOptionRef = null

Methods

__construct()

Constructs a new button group

public __construct(string $name, array<string, string> $options[, string|null &$selectedOption = null ][, Closure|null $onSelect = null ][, string|null $buttonGroupId = null ][, FUIButtonGroupStyle|null $buttonGroupStyle = null ]) : mixed
Parameters
$name : string

The name of the button group, will also be used for the ID, so must be unique

$options : array<string, string>

Array of key => label pairs

$selectedOption : string|null = null
$onSelect : Closure|null = null
$buttonGroupId : string|null = null
$buttonGroupStyle : FUIButtonGroupStyle|null = null

getSelectedOption()

Gets the selected option

public getSelectedOption() : string|null
Return values
string|null

hideLabel()

Hides the label for the button group

public hideLabel() : self
Return values
self

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

setId()

Sets the button group ID

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

setSelectedOption()

Sets the selected option

public setSelectedOption(string|null $selectedOption) : self
Parameters
$selectedOption : string|null
Return values
self

        
On this page

Search results