(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, icons ...*sdl.FRect)
| 1327 | } |
| 1328 | |
| 1329 | func 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 | |
| 1353 | func (bg *IconButtonGroup) SetButtons(icons ...*sdl.FRect) { |
| 1354 |
no test coverage detected