diff --git a/input.go b/input.go index 0dd44ae..febe668 100644 --- a/input.go +++ b/input.go @@ -10,7 +10,7 @@ import ( type Input struct { *Box - field *messeji.InputField + Field *messeji.InputField } func NewInput(prefix string, text string, onSelected func(text string) (handled bool)) *Input { @@ -31,28 +31,28 @@ func NewInput(prefix string, text string, onSelected func(text string) (handled return &Input{ Box: NewBox(), - field: i, + Field: i, } } // Clear clears the field's buffer. func (i *Input) Clear() { - i.field.SetText("") + i.Field.SetText("") } // Write writes to the field's buffer. func (i *Input) Write(p []byte) (n int, err error) { - return i.field.Write(p) + return i.Field.Write(p) } func (i *Input) Text() string { - return i.field.Text() + return i.Field.Text() } func (i *Input) SetRect(r image.Rectangle) { i.Box.rect = r - i.field.SetRect(r) + i.Field.SetRect(r) } func (i *Input) HandleMouse(cursor image.Point, pressed bool, clicked bool) (handled bool, err error) { @@ -60,13 +60,13 @@ func (i *Input) HandleMouse(cursor image.Point, pressed bool, clicked bool) (han } func (i *Input) HandleKeyboard() (handled bool, err error) { - err = i.field.Update() + err = i.Field.Update() return false, err } func (i *Input) Draw(screen *ebiten.Image) error { // Draw label. - i.field.Draw(screen) + i.Field.Draw(screen) return nil } diff --git a/text.go b/text.go index 2fe4712..6f5a5e1 100644 --- a/text.go +++ b/text.go @@ -10,7 +10,7 @@ import ( type Text struct { *Box - field *messeji.TextField + Field *messeji.TextField } func NewText(text string) *Text { @@ -25,28 +25,28 @@ func NewText(text string) *Text { return &Text{ Box: NewBox(), - field: l, + Field: l, } } // Clear clears the field's buffer. func (t *Text) Clear() { - t.field.SetText("") + t.Field.SetText("") } // Write writes to the field's buffer. func (t *Text) Write(p []byte) (n int, err error) { - return t.field.Write(p) + return t.Field.Write(p) } func (t *Text) Text() string { - return t.field.Text() + return t.Field.Text() } func (t *Text) SetRect(r image.Rectangle) { t.Box.rect = r - t.field.SetRect(r) + t.Field.SetRect(r) } func (t *Text) HandleMouse(cursor image.Point, pressed bool, clicked bool) (handled bool, err error) { @@ -59,6 +59,6 @@ func (t *Text) HandleKeyboard() (handled bool, err error) { func (t *Text) Draw(screen *ebiten.Image) error { // Draw label. - t.field.Draw(screen) + t.Field.Draw(screen) return nil }