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

Function NewIconButton

gui.go:197–218  ·  view source on GitHub ↗
(x, y float32, iconSrc *sdl.FRect, image Image, worldSpace bool, onClicked func())

Source from the content-addressed store, hash-verified

195}
196
197func NewIconButton(x, y float32, iconSrc *sdl.FRect, image Image, worldSpace bool, onClicked func()) *IconButton {
198
199 iconButton := &IconButton{
200 Rect: &sdl.FRect{x, y, float32(iconSrc.W), float32(iconSrc.H)},
201 originalSize: Vector{float32(iconSrc.W), float32(iconSrc.H)},
202 IconSrc: iconSrc,
203 WorldSpace: worldSpace,
204 OnPressed: onClicked,
205 HighlightingTargetColor: 1,
206 Active: true,
207 FadeOnInactive: true,
208 Image: image,
209 Scale: Vector{1, 1},
210 BGIconTint: ColorWhite.Clone(),
211 tween: gween.New(1.4, 1, 0.1, ease.InCirc),
212 CanPress: true,
213 }
214 iconButton.Highlighter = NewHighlighter(iconButton.Rect, worldSpace)
215 iconButton.Highlighter.HighlightMode = HighlightUnderline
216 return iconButton
217
218}
219
220func NewIconButtonTintless(x, y float32, iconSrc *sdl.FRect, image Image, worldSpace bool, onClicked func()) *IconButton {
221 b := NewIconButton(x, y, iconSrc, image, worldSpace, onClicked)

Callers 12

NewMenuFunction · 0.85
NewIconButtonTintlessFunction · 0.85
NewCheckboxFunction · 0.85
NewNumberSpinnerFunction · 0.85
NewDropdownFunction · 0.85
SetButtonsMethod · 0.85
NewSoundContentsFunction · 0.85
NewTimerContentsFunction · 0.85
NewLinkContentsFunction · 0.85
ResizeMethod · 0.85
AddPageMethod · 0.85
ConstructMenusFunction · 0.85

Calls 2

NewHighlighterFunction · 0.85
CloneMethod · 0.45

Tested by

no test coverage detected