Documentation ¶
Index ¶
- type InventoryWidget
- type TextWidget
- type UI
- func (ui *UI) AddLogEntry(text string)
- func (ui *UI) Render()
- func (ui *UI) SetInventoryPaneEnabled(enabled bool)
- func (ui *UI) SetScreenDimensions(width, height int)
- func (ui *UI) SetStatusBarText(text string)
- func (ui *UI) UpdateCharacterPane(time uint, currentHP, totalHP, vision, power, defense int32)
- func (ui *UI) UpdateInventoryPane(inventory *entity.Inventory)
- func (ui *UI) UpdateMutationsPane(mutations components.Mutations)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InventoryWidget ¶
type InventoryWidget struct {
// contains filtered or unexported fields
}
InventoryWidget is able to render a inventory.
func NewInventoryWidget ¶
func NewInventoryWidget(r *renderers.Renderer, font *ttf.Font, dst *sdl.Rect, drawBorder bool) *InventoryWidget
NewInventoryWidget returns a new NewInventoryWidget
func (*InventoryWidget) Render ¶
func (w *InventoryWidget) Render()
Render the InventoryWidget at the given dst rectangle with the given renderer.
func (*InventoryWidget) SetWrapLength ¶
func (w *InventoryWidget) SetWrapLength(wrapLength int)
SetWrapLength defines a new wrap length on how many pixel the text should be wrapped automatically.
func (*InventoryWidget) UpdateInventory ¶
func (w *InventoryWidget) UpdateInventory(inventory *entity.Inventory)
UpdateInventory updates the inventory with the new list of entities.
type TextWidget ¶
type TextWidget struct {
// contains filtered or unexported fields
}
TextWidget is able to render character stats
func NewTextWidget ¶
func NewTextWidget(r *renderers.Renderer, font *ttf.Font, dst *sdl.Rect, drawBorder bool) *TextWidget
NewTextWidget returns a new TextWidget
func (*TextWidget) AddRow ¶
func (w *TextWidget) AddRow(row string)
AddRow adds a new line of text. If number of lines > max lines, the oldest will be removed.
func (*TextWidget) Render ¶
func (w *TextWidget) Render()
Render the TextWidget at the given dst rectangle with the given renderer.
func (*TextWidget) SetText ¶
func (w *TextWidget) SetText(rows []string)
SetText changes the current text to the rows provided as an argument.
func (*TextWidget) SetWrapLength ¶
func (w *TextWidget) SetWrapLength(wrapLength int)
SetWrapLength defines a new wrap length on how many pixel the text should be wrapped automatically.
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI holds all functions and data related to the UI.
func (*UI) AddLogEntry ¶
AddLogEntry adds a new entry to the log pane.
func (*UI) SetInventoryPaneEnabled ¶
SetInventoryPaneEnabled shows or hides the inventory.
func (*UI) SetScreenDimensions ¶
SetScreenDimensions sets a new width and height for the current window where the UI is rendered. UI will calculate from that how to position the UI elements on the screen, so make sure it is always current.
func (*UI) SetStatusBarText ¶
SetStatusBarText sets a new text in the status bar.
func (*UI) UpdateCharacterPane ¶
UpdateCharacterPane updates the character infos with the information provided.
func (*UI) UpdateInventoryPane ¶
UpdateInventoryPane updates the inventory info with the newly provided list.
func (*UI) UpdateMutationsPane ¶
func (ui *UI) UpdateMutationsPane(mutations components.Mutations)
UpdateMutationsPane updates the mutation info with the newly provided list.