(x, y float32, iconSrc *sdl.FRect, image Image, worldSpace bool, onClicked func())
| 195 | } |
| 196 | |
| 197 | func 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 | |
| 220 | func NewIconButtonTintless(x, y float32, iconSrc *sdl.FRect, image Image, worldSpace bool, onClicked func()) *IconButton { |
| 221 | b := NewIconButton(x, y, iconSrc, image, worldSpace, onClicked) |
no test coverage detected