MCPcopy Create free account
hub / github.com/SolarLune/masterplan / NewIconButtonGroup

Function NewIconButtonGroup

gui.go:1329–1351  ·  view source on GitHub ↗
(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, icons ...*sdl.FRect)

Source from the content-addressed store, hash-verified

1327}
1328
1329func NewIconButtonGroup(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, icons ...*sdl.FRect) *IconButtonGroup {
1330
1331 group := &IconButtonGroup{
1332 Rect: rect,
1333 OnChoose: onChoose,
1334 Buttons: []*IconButton{},
1335 Property: property,
1336 WorldSpace: worldSpace,
1337 Icons: icons,
1338 }
1339
1340 group.SetButtons(icons...)
1341
1342 if rect == nil {
1343 group.Rect = &sdl.FRect{0, 0, 0, 32}
1344 for _, b := range group.Buttons {
1345 group.Rect.W += b.Rect.W
1346 }
1347 }
1348
1349 return group
1350
1351}
1352
1353func (bg *IconButtonGroup) SetButtons(icons ...*sdl.FRect) {
1354

Callers 3

NewTimerContentsFunction · 0.85
NewLinkContentsFunction · 0.85
ConstructMenusFunction · 0.85

Calls 1

SetButtonsMethod · 0.95

Tested by

no test coverage detected