ui

package
v0.0.0-...-bf68151 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PopupWidth = 160 - popupMargin*2
)

Variables

This section is empty.

Functions

func DrawNinePatches

func DrawNinePatches(dst, src *ebiten.Image, width, height int, geoM *ebiten.GeoM, colorM *ebiten.ColorM)

Types

type Button

type Button struct {
	Image         *ebiten.Image
	PressedImage  *ebiten.Image
	DisabledImage *ebiten.Image

	Lang language.Tag
	// contains filtered or unexported fields
}

func NewButton

func NewButton(x, y, width, height int, soundName string) *Button

func NewImageButton

func NewImageButton(x, y int, image *ebiten.Image, pressedImage *ebiten.Image, soundName string) *Button

func NewTextButton

func NewTextButton(x, y, width, height int, soundName string) *Button

func (*Button) Disable

func (b *Button) Disable()

func (*Button) Draw

func (b *Button) Draw(screen *ebiten.Image)

func (*Button) DrawAsChild

func (b *Button) DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)

func (*Button) Enable

func (b *Button) Enable()

func (*Button) HandleInput

func (b *Button) HandleInput(offsetX, offsetY int) bool

func (*Button) Hide

func (b *Button) Hide()

func (*Button) Region

func (b *Button) Region() image.Rectangle

func (*Button) SetColor

func (b *Button) SetColor(clr color.Color)

func (*Button) SetOnPressed

func (b *Button) SetOnPressed(onPressed func(button *Button))

func (*Button) SetScale

func (b *Button) SetScale(scale float64)

func (*Button) SetText

func (b *Button) SetText(text string)

func (*Button) SetWidth

func (b *Button) SetWidth(width int)

func (*Button) SetX

func (b *Button) SetX(x int)

func (*Button) SetY

func (b *Button) SetY(y int)

func (*Button) Show

func (b *Button) Show()

func (*Button) Update

func (b *Button) Update()

type Credits

type Credits struct {
	// contains filtered or unexported fields
}

func NewCredits

func NewCredits() *Credits

func (*Credits) Draw

func (c *Credits) Draw(screen *ebiten.Image)

func (*Credits) Hide

func (c *Credits) Hide()

func (*Credits) SetCloseButtonVisible

func (c *Credits) SetCloseButtonVisible(visible bool)

func (*Credits) SetData

func (c *Credits) SetData(credits *data.Credits)

func (*Credits) Show

func (c *Credits) Show()

func (*Credits) Update

func (c *Credits) Update()

func (*Credits) Visible

func (c *Credits) Visible() bool

type GameHeader

type GameHeader struct {
	// contains filtered or unexported fields
}

func NewGameHeader

func NewGameHeader() *GameHeader

func (*GameHeader) Close

func (g *GameHeader) Close()

func (*GameHeader) Draw

func (g *GameHeader) Draw(screen *ebiten.Image)

func (*GameHeader) Open

func (g *GameHeader) Open()

func (*GameHeader) SetOnCameraButtonPressed

func (g *GameHeader) SetOnCameraButtonPressed(f func())

func (*GameHeader) SetOnTitleButtonPressed

func (g *GameHeader) SetOnTitleButtonPressed(f func())

func (*GameHeader) Update

func (g *GameHeader) Update(paused bool)

type ImageView

type ImageView struct {
	// contains filtered or unexported fields
}

func NewImageView

func NewImageView(x, y int, scale float64, image *ebiten.Image) *ImageView

func (*ImageView) Draw

func (i *ImageView) Draw(screen *ebiten.Image)

func (*ImageView) DrawAsChild

func (i *ImageView) DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)

func (*ImageView) HandleInput

func (i *ImageView) HandleInput(offsetX, offsetY int) bool

func (*ImageView) Region

func (i *ImageView) Region() image.Rectangle

func (*ImageView) SetFilter

func (i *ImageView) SetFilter(filter ebiten.Filter)

func (*ImageView) Update

func (i *ImageView) Update()

type Inventory

type Inventory struct {
	// contains filtered or unexported fields
}

func NewInventory

func NewInventory(x, y int, showItemName bool) *Inventory

func (*Inventory) ActiveItemID

func (i *Inventory) ActiveItemID() int

func (*Inventory) Draw

func (i *Inventory) Draw(screen *ebiten.Image)

func (*Inventory) Hide

func (i *Inventory) Hide()

func (*Inventory) Mode

func (i *Inventory) Mode() InventoryMode

func (*Inventory) SetActiveItemID

func (i *Inventory) SetActiveItemID(activeItemID int)

func (*Inventory) SetCombineItemID

func (i *Inventory) SetCombineItemID(combineItemID int)

func (*Inventory) SetDisabled

func (i *Inventory) SetDisabled(disabled bool)

func (*Inventory) SetItems

func (i *Inventory) SetItems(items []*data.Item)

func (*Inventory) SetMode

func (i *Inventory) SetMode(mode InventoryMode)

func (*Inventory) SetOnActiveItemPressed

func (i *Inventory) SetOnActiveItemPressed(f func(inventory *Inventory))

func (*Inventory) SetOnBackPressed

func (i *Inventory) SetOnBackPressed(f func(inventory *Inventory))

func (*Inventory) SetOnOutsidePressed

func (i *Inventory) SetOnOutsidePressed(f func(inventory *Inventory))

func (*Inventory) SetOnSlotPressed

func (i *Inventory) SetOnSlotPressed(f func(inventory *Inventory, index int))

func (*Inventory) Show

func (i *Inventory) Show()

func (*Inventory) Update

func (i *Inventory) Update(texts *data.Texts)

func (*Inventory) Visible

func (i *Inventory) Visible() bool

type InventoryMode

type InventoryMode int
const (
	DefaultMode InventoryMode = iota
	PreviewMode
)

type ItemPreviewPopup

type ItemPreviewPopup struct {
	// contains filtered or unexported fields
}

func NewItemPreviewPopup

func NewItemPreviewPopup(y int) *ItemPreviewPopup

func (*ItemPreviewPopup) CloseButtonEnabled

func (i *ItemPreviewPopup) CloseButtonEnabled() bool

func (*ItemPreviewPopup) Draw

func (i *ItemPreviewPopup) Draw(screen *ebiten.Image)

func (*ItemPreviewPopup) HandleInput

func (i *ItemPreviewPopup) HandleInput(offsetX, offsetY int) bool

func (*ItemPreviewPopup) Hide

func (i *ItemPreviewPopup) Hide()

func (*ItemPreviewPopup) SetActiveItem

func (i *ItemPreviewPopup) SetActiveItem(item *data.Item)

func (*ItemPreviewPopup) SetCombineItem

func (i *ItemPreviewPopup) SetCombineItem(item *data.Item, combine *data.Combine)

func (*ItemPreviewPopup) SetEnabled

func (i *ItemPreviewPopup) SetEnabled(enabled bool)

func (*ItemPreviewPopup) SetOnActionPressed

func (i *ItemPreviewPopup) SetOnActionPressed(f func(itemPreviewPopup *ItemPreviewPopup))

func (*ItemPreviewPopup) SetOnClosePressed

func (i *ItemPreviewPopup) SetOnClosePressed(f func(itemPreviewPopup *ItemPreviewPopup))

func (*ItemPreviewPopup) Show

func (i *ItemPreviewPopup) Show()

func (*ItemPreviewPopup) Update

func (i *ItemPreviewPopup) Update(lang language.Tag)

func (*ItemPreviewPopup) Visible

func (i *ItemPreviewPopup) Visible() bool

type Label

type Label struct {
	Text      string
	Scale     float64
	Color     color.Color
	TextAlign data.TextAlign
	// contains filtered or unexported fields
}

func NewLabel

func NewLabel(x, y int) *Label

func (*Label) Draw

func (l *Label) Draw(screen *ebiten.Image)

func (*Label) DrawAsChild

func (l *Label) DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)

func (*Label) HandleInput

func (l *Label) HandleInput(offsetX, offsetY int) bool

func (*Label) Hide

func (l *Label) Hide()

func (*Label) Region

func (l *Label) Region() image.Rectangle

func (*Label) Show

func (l *Label) Show()

func (*Label) Update

func (l *Label) Update()

type Minigame

type Minigame interface {
	ID() int
	Score() int
	ReqScore() int
	AddScore(score int)
	Active() bool
	LastActiveAt() int64
	MarkLastActive()
	Success() bool
}

type MinigamePopup

type MinigamePopup struct {
	// contains filtered or unexported fields
}

func NewMinigamePopup

func NewMinigamePopup(y int) *MinigamePopup

func (*MinigamePopup) ActivateBoostMode

func (m *MinigamePopup) ActivateBoostMode()

func (*MinigamePopup) Draw

func (m *MinigamePopup) Draw(screen *ebiten.Image)

func (*MinigamePopup) HandleInput

func (m *MinigamePopup) HandleInput(offsetX, offsetY int) bool

func (*MinigamePopup) Hide

func (m *MinigamePopup) Hide()

func (*MinigamePopup) SetAdsLoaded

func (m *MinigamePopup) SetAdsLoaded(loaded bool)

func (*MinigamePopup) SetOnClose

func (m *MinigamePopup) SetOnClose(f func())

func (*MinigamePopup) SetOnProgress

func (m *MinigamePopup) SetOnProgress(f func(int))

func (*MinigamePopup) SetOnRequestRewardedAds

func (m *MinigamePopup) SetOnRequestRewardedAds(f func())

func (*MinigamePopup) SetOnSave

func (m *MinigamePopup) SetOnSave(f func())

func (*MinigamePopup) Show

func (m *MinigamePopup) Show()

func (*MinigamePopup) Update

func (m *MinigamePopup) Update(minigameState Minigame)

func (*MinigamePopup) Visible

func (m *MinigamePopup) Visible() bool

type Node

type Node interface {
	HandleInput(offsetX, offsetY int) bool
	Update()
	DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)
	Region() image.Rectangle
}
type Popup struct {
	// contains filtered or unexported fields
}

func NewPopup

func NewPopup(y, height int) *Popup

func (*Popup) AddChild

func (p *Popup) AddChild(node Node)

func (*Popup) Draw

func (p *Popup) Draw(screen *ebiten.Image)

func (*Popup) HandleInput

func (p *Popup) HandleInput(offsetX, offsetY int) bool

func (*Popup) Hide

func (p *Popup) Hide()

func (*Popup) Show

func (p *Popup) Show()

func (*Popup) Update

func (p *Popup) Update()

func (*Popup) Visible

func (p *Popup) Visible() bool

type Slider

type Slider struct {
	// contains filtered or unexported fields
}

func NewSlider

func NewSlider(x, y, width, min, max, value int) *Slider

func (*Slider) Draw

func (s *Slider) Draw(screen *ebiten.Image)

func (*Slider) DrawAsChild

func (s *Slider) DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)

func (*Slider) SetOnReleased

func (s *Slider) SetOnReleased(onReleased func(slider *Slider, value int))

func (*Slider) SetOnValueChanged

func (s *Slider) SetOnValueChanged(onValueChanged func(slider *Slider, value int))

func (*Slider) Update

func (s *Slider) Update()

func (*Slider) UpdateAsChild

func (s *Slider) UpdateAsChild(visible bool, offsetX, offsetY int)

func (*Slider) Value

func (s *Slider) Value() int

type SwitchButton

type SwitchButton struct {
	// contains filtered or unexported fields
}

func NewSwitchButton

func NewSwitchButton(x, y int, on bool) *SwitchButton

func (*SwitchButton) Draw

func (s *SwitchButton) Draw(screen *ebiten.Image)

func (*SwitchButton) DrawAsChild

func (s *SwitchButton) DrawAsChild(screen *ebiten.Image, offsetX, offsetY int)

func (*SwitchButton) Hide

func (s *SwitchButton) Hide()

func (*SwitchButton) On

func (s *SwitchButton) On() bool

func (*SwitchButton) SetOn

func (s *SwitchButton) SetOn(on bool)

func (*SwitchButton) SetOnToggled

func (s *SwitchButton) SetOnToggled(onToggled func(SwitchButton *SwitchButton, value bool))

func (*SwitchButton) SetX

func (s *SwitchButton) SetX(x int)

func (*SwitchButton) SetY

func (s *SwitchButton) SetY(y int)

func (*SwitchButton) Show

func (s *SwitchButton) Show()

func (*SwitchButton) Update

func (s *SwitchButton) Update()

func (*SwitchButton) UpdateAsChild

func (s *SwitchButton) UpdateAsChild(visible bool, offsetX, offsetY int)

type TitleView

type TitleView struct {
	// contains filtered or unexported fields
}

func NewTitleView

func NewTitleView(sceneWidth, sceneHeight int) *TitleView

func (*TitleView) Draw

func (t *TitleView) Draw(screen *ebiten.Image)

func (*TitleView) ResetWaitingRequestID

func (t *TitleView) ResetWaitingRequestID()

func (*TitleView) Resize

func (t *TitleView) Resize(sceneWidth, sceneHeight int)

func (*TitleView) SetOnMoreGames

func (t *TitleView) SetOnMoreGames(f func())

func (*TitleView) SetOnQuit

func (t *TitleView) SetOnQuit(f func())

func (*TitleView) SetOnRemoveAds

func (t *TitleView) SetOnRemoveAds(f func())

func (*TitleView) SetOnSettings

func (t *TitleView) SetOnSettings(f func())

func (*TitleView) SetOnStartGame

func (t *TitleView) SetOnStartGame(f func())

func (*TitleView) SetWaitingRequestID

func (t *TitleView) SetWaitingRequestID(id int)

func (*TitleView) ShakeStartGameButton

func (t *TitleView) ShakeStartGameButton()

func (*TitleView) Update

func (t *TitleView) Update(game *data.Game, hasProgress bool, isAdsRemoved bool) error

func (*TitleView) WaitingRequestID

func (t *TitleView) WaitingRequestID() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL