flamendless / Slab

An immediate mode GUI for the Love2D framework.
MIT License
286 stars 25 forks source link

Add a Label override to Slab.Button's Options table. #131

Closed MatthewBlanchard closed 2 years ago

MatthewBlanchard commented 2 years ago

The item id of a button is tied to a it's label. Sometimes I want multiple buttons with the same label, but that causes issues with hover events. Label override would let you use the first string argument to button as an ID.

flamendless commented 2 years ago

Will add this API for the v1.0.0 release:

Slab.Button("id", {Label = "MyButton"})

if no opt.Label is passed, the id and the label will be the first argument "id"

flamendless commented 2 years ago

Hi, this has been committed now to the v1.0.0 branch