A single option of an fl_menu: a DButton in the theme's colors with an optional icon.
Options are created with the menu's add_option; set_icon and set_icon_size put a
material on the left side of one.
Summary
Methods
Init()client
Applies the theme's menu font and text color to the item.
OnMousePressed(mouse)client
Calls DoClick on a left or right click, then forwards to DButton.OnMouseReleased.
Paint(w, h)client
Draws the highlight of the item while it is hovered, and its icon if one is set.
set_icon(icon)client
Sets the icon drawn on the left side of the item.
set_icon_size(w, h)client
Sets the size the icon is drawn at.
Think()client
Fades the hover highlight in and out.
Methods
Applies the theme's menu font and text color to the item.
Calls DoClick on a left or right click, then forwards to DButton.OnMouseReleased.
Parameters
- mouse Number mouse button code, one of the MOUSE_ enums
Returns
- Any result of DButton.OnMouseReleased, normally nil
Draws the highlight of the item while it is hovered, and its icon if one is set.
Parameters
- w Number panel width
- h Number panel height
Sets the icon drawn on the left side of the item.
Parameters
- icon String path of the material, as accepted by util.get_material
Sets the size the icon is drawn at.
Parameters
- w Number width in pixels
- h Number optional, defaults to
wheight in pixels
Fades the hover highlight in and out.