mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
test KeyDown event
This commit is contained in:
parent
2dff963106
commit
238e250499
13
main.go
13
main.go
@ -61,16 +61,15 @@ func run() int {
|
|||||||
if ev.Type == event.KEYDOWN {
|
if ev.Type == event.KEYDOWN {
|
||||||
fmt.Println(ev)
|
fmt.Println(ev)
|
||||||
if ev.Data["Key"] == "Q" {
|
if ev.Data["Key"] == "Q" {
|
||||||
|
main_screen.OnExitCb()
|
||||||
return 0
|
return 0
|
||||||
}
|
}else if ev.Data["Key"] == "D" {
|
||||||
if ev.Data["Key"] == "Escape" {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
if ev.Data["Key"] == "T" {
|
|
||||||
time.Delay(1000)
|
time.Delay(1000)
|
||||||
}
|
}else if ev.Data["Key"] == "P" {
|
||||||
if ev.Data["Key"] == "P" {
|
|
||||||
event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simpify the stuff
|
event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simpify the stuff
|
||||||
|
|
||||||
|
}else {
|
||||||
|
main_screen.KeyDown(ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package UI
|
package UI
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
// "fmt"
|
||||||
|
|
||||||
"github.com/veandco/go-sdl2/sdl"
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
"github.com/veandco/go-sdl2/ttf"
|
"github.com/veandco/go-sdl2/ttf"
|
||||||
@ -256,7 +256,7 @@ func (self *IconItem) Draw() {
|
|||||||
lab_w,lab_h:= self.Label.Size()
|
lab_w,lab_h:= self.Label.Size()
|
||||||
|
|
||||||
if self.Align == ALIGN["VCenter"] {
|
if self.Align == ALIGN["VCenter"] {
|
||||||
fmt.Println("IconItem Draw VCenter:",lab_w,lab_h,self.Label.GetText())
|
// fmt.Println("IconItem Draw VCenter:",lab_w,lab_h,self.Label.GetText())
|
||||||
|
|
||||||
self.Label.NewCoord( self.PosX - lab_w/2 + parent_x, self.PosY + self.Height/2+6+parent_y)
|
self.Label.NewCoord( self.PosX - lab_w/2 + parent_x, self.PosY + self.Height/2+6+parent_y)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user