Skip to content

Commit cc44e07

Browse files
committed
renamed SPINNER ControlID, other minor changes
- renamed SPINNER ControlID to CONTROL11 (as raygui.h did) - add AsColor() method for PropertyValue - add NewColorPropertyValue() for easy PropertyValue generation from rl.Color
1 parent cbef5d1 commit cc44e07

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

raygui/raygui.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ import (
1515
rl "github.com/gen2brain/raylib-go/raylib"
1616
)
1717

18-
const (
19-
SCROLLBAR_LEFT_SIDE = 0
20-
SCROLLBAR_RIGHT_SIDE = 1
21-
)
22-
2318
type (
2419
ControlID uint16
2520
PropertyID uint16
@@ -32,6 +27,14 @@ func (p PropertyID) IsExtended() bool {
3227
return p >= 16
3328
}
3429

30+
func (v PropertyValue) AsColor() rl.Color {
31+
return rl.Color{uint8(v >> 24), uint8(v >> 16), uint8(v >> 8), uint8(v)}
32+
}
33+
34+
func NewColorPropertyValue(color rl.Color) PropertyValue {
35+
return PropertyValue(uint32(color.R)<<24 + uint32(color.G)<<16 + uint32(color.B)<<8 + uint32(color.A))
36+
}
37+
3538
// Gui control state
3639
const (
3740
STATE_NORMAL PropertyValue = iota
@@ -63,6 +66,11 @@ const (
6366
TEXT_WRAP_WORD
6467
)
6568

69+
const (
70+
SCROLLBAR_LEFT_SIDE PropertyValue = iota
71+
SCROLLBAR_RIGHT_SIDE
72+
)
73+
6674
// Gui controls
6775
const (
6876
// Default -> populates to all controls when set
@@ -79,7 +87,7 @@ const (
7987
DROPDOWNBOX
8088
TEXTBOX // Used also for: TEXTBOXMULTI
8189
VALUEBOX
82-
SPINNER
90+
CONTROL11
8391
LISTVIEW
8492
COLORPICKER
8593
SCROLLBAR

0 commit comments

Comments
 (0)