Documentation ¶
Index ¶
- Constants
- func Rect(x, y, w, h int) image.Rectangle
- func TouchPositions() []image.Point
- type Alignment
- type Button
- type Image
- func (i *Image) Draw(dst *ebiten.Image)
- func (i *Image) GetHeight() int
- func (i *Image) GetPosition() image.Point
- func (i *Image) GetWidth() int
- func (i *Image) Rescale(x, y float64)
- func (i *Image) Resize(w, h int)
- func (i *Image) ScaledSize() image.Point
- func (i *Image) SetImageType(image res.UiImageType)
- func (i *Image) SetPosition(x, y int)
- func (i *Image) SetSourceRect(rect image.Rectangle)
- func (i *Image) SetWidth(w int)
- func (i *Image) Size() image.Point
- func (i *Image) Update(*Ui)
- type ImageButton
- type Label
- type NinePatch
- func (n *NinePatch) Draw(dst *ebiten.Image)
- func (n *NinePatch) Position() image.Point
- func (n *NinePatch) Resize(w, h int)
- func (n *NinePatch) SetPosition(x, y int)
- func (n *NinePatch) SetSourceRect(rect image.Rectangle)
- func (n *NinePatch) SetTargetRect(rect image.Rectangle)
- func (n *NinePatch) Update(*Ui)
- type Overlay
- type RepeatImage
- type StretchedButton
- type TextButton
- type Ui
- func (u *Ui) AddDebugLabel(x, y int, text string) *Label
- func (u *Ui) AddDebugOverlay() *Overlay
- func (u *Ui) AddImage(src *ebiten.Image, x, y, w, h int) *Image
- func (u *Ui) AddImageButton(image res.UiImageType, x, y, w, h int) *ImageButton
- func (u *Ui) AddLabel(x, y int, text string) *Label
- func (u *Ui) AddNinePatch(image res.UiImageType, x, y, w, h int) *NinePatch
- func (u *Ui) AddRepeatImage(image res.UiImageType, x, y, w, h int) *RepeatImage
- func (u *Ui) AddStretchedButton(y int, align Alignment, text string) *StretchedButton
- func (u *Ui) AddTextButton(x, y, w, h int, text string) *TextButton
- func (u *Ui) AddTitle(x, y int, text string) *Label
- func (u *Ui) Draw(screen *ebiten.Image)
- func (u *Ui) Update(screenSize image.Point)
- type Widget
Constants ¶
View Source
const ( // ScreenPadding is the padding from the outside to any content ScreenPadding = 32 // ButtonHeight is the default height for buttons ButtonHeight = 64 )
Sizes
View Source
const ( // ButtonFontSize is the default font size for buttons ButtonFontSize = 18 // TitleFontSize is the default font size for titles TitleFontSize = 54 // DebugFontSize is the default font size for smaller (debug) text DebugFontSize = 18 )
Font sizes
Variables ¶
This section is empty.
Functions ¶
func TouchPositions ¶
TouchPositions gets all currently active positions (mouse or touch)
Types ¶
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
Button is an abstract widget that can be pressed
func (*Button) SetOnPressed ¶
func (*Button) SetPosition ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is an image, or a sheet of multiple images
func (*Image) GetPosition ¶
func (*Image) ScaledSize ¶
func (*Image) SetImageType ¶
func (i *Image) SetImageType(image res.UiImageType)
func (*Image) SetPosition ¶
func (*Image) SetSourceRect ¶
type ImageButton ¶
ImageButton is a button with an image
func NewImageButton ¶
func NewImageButton(image *ebiten.Image, x, y, w, h int) *ImageButton
func (*ImageButton) Draw ¶
func (i *ImageButton) Draw(dst *ebiten.Image)
func (*ImageButton) SetPosition ¶
func (i *ImageButton) SetPosition(x, y int)
func (*ImageButton) Size ¶
func (i *ImageButton) Size() image.Point
func (*ImageButton) Update ¶
func (i *ImageButton) Update(ui *Ui)
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
func (*Label) GetPosition ¶ added in v0.4.2
func (*Label) SetPosition ¶
type NinePatch ¶
type NinePatch struct {
// contains filtered or unexported fields
}
NinePatch is a nine-patch image
func NewNinePatch ¶
func (*NinePatch) SetPosition ¶
func (*NinePatch) SetSourceRect ¶
func (*NinePatch) SetTargetRect ¶
type RepeatImage ¶
type RepeatImage struct { *Image // contains filtered or unexported fields }
func NewRepeatImage ¶
func NewRepeatImage(src *ebiten.Image, x, y, w, h int) *RepeatImage
func (*RepeatImage) Draw ¶
func (r *RepeatImage) Draw(dst *ebiten.Image)
func (*RepeatImage) SetSize ¶
func (r *RepeatImage) SetSize(size image.Point)
func (*RepeatImage) Update ¶
func (r *RepeatImage) Update(*Ui)
type StretchedButton ¶
type StretchedButton struct { *TextButton // contains filtered or unexported fields }
StretchedButton is a button that stretches horizontally across the screen
func NewStretchedButton ¶
func (*StretchedButton) Draw ¶
func (s *StretchedButton) Draw(dst *ebiten.Image)
func (*StretchedButton) Update ¶
func (s *StretchedButton) Update(ui *Ui)
type TextButton ¶
TextButton is a button with text
func NewTextButton ¶
func NewTextButton(background *ebiten.Image, font font.Face, x, y, w, h int, text string) *TextButton
func (*TextButton) Draw ¶
func (t *TextButton) Draw(dst *ebiten.Image)
func (*TextButton) Update ¶
func (t *TextButton) Update(ui *Ui)
type Ui ¶
type Ui struct {
// contains filtered or unexported fields
}
func (*Ui) AddDebugOverlay ¶
func (*Ui) AddImageButton ¶
func (u *Ui) AddImageButton(image res.UiImageType, x, y, w, h int) *ImageButton
func (*Ui) AddNinePatch ¶
func (u *Ui) AddNinePatch(image res.UiImageType, x, y, w, h int) *NinePatch
func (*Ui) AddRepeatImage ¶
func (u *Ui) AddRepeatImage(image res.UiImageType, x, y, w, h int) *RepeatImage
func (*Ui) AddStretchedButton ¶
func (u *Ui) AddStretchedButton(y int, align Alignment, text string) *StretchedButton
func (*Ui) AddTextButton ¶
func (u *Ui) AddTextButton(x, y, w, h int, text string) *TextButton
Click to show internal directories.
Click to hide internal directories.