mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-13 00:18:52 +01:00
keyboard showed up
This commit is contained in:
parent
fc7afbb680
commit
d043f2fecf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -95,6 +95,11 @@ type Keyboard struct {
|
|||||||
func NewKeyboard() *Keyboard {
|
func NewKeyboard() *Keyboard {
|
||||||
p := &Keyboard{}
|
p := &Keyboard{}
|
||||||
|
|
||||||
|
p.PageIconMargin = 20
|
||||||
|
p.SelectedIconTopOffset = 20
|
||||||
|
|
||||||
|
p.Align = ALIGN["SLeft"]
|
||||||
|
|
||||||
p.EasingDur = 10
|
p.EasingDur = 10
|
||||||
|
|
||||||
p.SectionNumbers = 3
|
p.SectionNumbers = 3
|
||||||
@ -199,7 +204,7 @@ func (self *Keyboard) Init() {
|
|||||||
start_x = (self.Width-fw- len(self.Secs[i][j])*word_margin)/2+word_margin/2
|
start_x = (self.Width-fw- len(self.Secs[i][j])*word_margin)/2+word_margin/2
|
||||||
start_x = start_x + i*self.Width
|
start_x = start_x + i*self.Width
|
||||||
|
|
||||||
start_y = 84 * j * (word_margin+14)
|
start_y = 84 + j * (word_margin+14)
|
||||||
|
|
||||||
for _,val := range self.Secs[i][j] {
|
for _,val := range self.Secs[i][j] {
|
||||||
ti := NewTextItem()
|
ti := NewTextItem()
|
||||||
@ -432,11 +437,23 @@ func (self *Keyboard) KeyDown( ev *event.Event) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ev.Data["Key"] == CurKeys["B"] {
|
if ev.Data["Key"] == CurKeys["B"] || ev.Data["Key"] == CurKeys["Enter"] {
|
||||||
self.ClickOnChar()
|
self.ClickOnChar()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ev.Data["Key"] == CurKeys["X"] {
|
||||||
|
if self.SectionIndex <= 0 {
|
||||||
|
self.LeftOrRight = -1
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.SectionIndex >= (self.SectionNumbers - 1) {
|
||||||
|
self.LeftOrRight = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
self.ShiftKeyboardPage()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ev.Data["Key"] == CurKeys["Menu"] {
|
if ev.Data["Key"] == CurKeys["Menu"] {
|
||||||
self.ReturnToUpLevelPage()
|
self.ReturnToUpLevelPage()
|
||||||
|
|||||||
@ -32,6 +32,9 @@ type TextItem struct {
|
|||||||
|
|
||||||
func NewTextItem() *TextItem {
|
func NewTextItem() *TextItem {
|
||||||
p := &TextItem{}
|
p := &TextItem{}
|
||||||
|
|
||||||
|
p.Align = ALIGN["VCenter"]
|
||||||
|
|
||||||
p.Color = &color.Color{83,83,83,255}
|
p.Color = &color.Color{83,83,83,255}
|
||||||
p.MyType = ICON_TYPES["LETTER"]
|
p.MyType = ICON_TYPES["LETTER"]
|
||||||
p.Bold = false
|
p.Bold = false
|
||||||
|
|||||||
@ -94,7 +94,7 @@ func (self *Textarea) AppendAndBlitText(alphabet string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
fmt.Printf("is Full %s",strings.Join(self.MyWords,""))
|
fmt.Printf("is Full %s\n",strings.Join(self.MyWords,""))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user