Button
Definition
Button with the ability to detect clicks. Many aspects of its appearance can be changed, as well as whether it is clickable (Enabled
). Its properties can be changed in the Designer or in the Blocks Editor.
Properties
- BackgroundColor
- Specifies the
Button
’s background color as an alpha-red-green-blue integer. If anImage
has been set, the color change will not be visible until theImage
is removed. - Enabled
- Specifies whether the
Button
should be active and clickable. - FontBold
- Specifies whether the text of the
Button
should be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
Button
should be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
Button
, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
Button
as default, serif, sans serif, or monospace. - Height
- Specifies the
Button
’s vertical height, measured in pixels. - HeightPercent
- Specifies the
Button
’s vertical height as a percentage of theScreen
’sHeight
. - Image
- Specifies the path of the
Button
’s image. If there is both anImage
and aBackgroundColor
specified, only theImage
will be visible. - Shape
- Specifies the shape of the
Button
. The valid values for this property are0
(default),1
(rounded),2
(rectangle), and3
(oval). TheShape
will not be visible if anImage
is used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
Button
with an assignedImage
is pressed. - Text
- Specifies the text displayed by the
Button
. - TextAlignment
- Specifies the alignment of the
Button
’s text. Valid values are:0
(normal; e.g., left-justified if text is written left to right),1
(center), or2
(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
Button
as an alpha-red-green-blue integer. - Visible
- Specifies whether the
Button
should be visible on the screen. Value istrue
if theButton
is showing andfalse
if hidden. - Width
- Specifies the horizontal width of the
Button
, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Button
as a percentage of theScreen
’sWidth
.