center the window in a nicer way and add todo
This commit is contained in:
+11
-4
@@ -116,7 +116,6 @@ func raymenu(options []string) (choice string, result RayMenuResult) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if enter {
|
if enter {
|
||||||
rl.EndDrawing() // TODO: dont need this?
|
|
||||||
rl.CloseWindow()
|
rl.CloseWindow()
|
||||||
if cursor < len(matched) {
|
if cursor < len(matched) {
|
||||||
return options[matched[cursor].Idx], RayMenuResult_Chosen
|
return options[matched[cursor].Idx], RayMenuResult_Chosen
|
||||||
@@ -137,6 +136,9 @@ func raymenu(options []string) (choice string, result RayMenuResult) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if i == cursor {
|
if i == cursor {
|
||||||
|
// TODO if cursor is not visible then keep some offset or make
|
||||||
|
// 2d camera so you can scroll through all the options if you
|
||||||
|
// want
|
||||||
rl.DrawCircle(
|
rl.DrawCircle(
|
||||||
int32(bounds.X)+int32(bounds.Height)/2,
|
int32(bounds.X)+int32(bounds.Height)/2,
|
||||||
int32(bounds.Y)+int32(bounds.Height)/2,
|
int32(bounds.Y)+int32(bounds.Height)/2,
|
||||||
@@ -175,11 +177,16 @@ func initialize() State {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
monitor := rl.GetCurrentMonitor()
|
||||||
|
monitorWidth := rl.GetMonitorWidth(monitor)
|
||||||
|
monitorHeight := rl.GetMonitorHeight(monitor)
|
||||||
rl.SetWindowSize(
|
rl.SetWindowSize(
|
||||||
width,
|
width,
|
||||||
rl.GetMonitorHeight(
|
monitorHeight/2,
|
||||||
rl.GetCurrentMonitor(),
|
)
|
||||||
),
|
rl.SetWindowPosition(
|
||||||
|
monitorWidth/2-rl.GetScreenWidth()/2,
|
||||||
|
monitorHeight/2-rl.GetScreenHeight()/2,
|
||||||
)
|
)
|
||||||
|
|
||||||
return State{
|
return State{
|
||||||
|
|||||||
Reference in New Issue
Block a user