Documentation ¶
Index ¶
- type Map
- func (e *Map) Draw(dst *ebiten.Image)
- func (e *Map) IsDestroyed() bool
- func (e *Map) IsEnabled() bool
- func (e *Map) IsVisible() bool
- func (e *Map) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, ...)
- func (e *Map) Name() string
- func (e *Map) RenderIndex() int64
- func (e *Map) Route(startX, startY, endX, endY int) ([]*common.Edge, error)
- func (e *Map) SetData(data MapData) error
- func (e *Map) SetEnabled(isEnabled bool)
- func (e *Map) SetIsDestroyed(isDestroyed bool)
- func (e *Map) SetOnPressFunction(f func())
- func (e *Map) SetOnPressed(f func(e *Map))
- func (e *Map) SetRenderIndex(renderIndex int64)
- func (e *Map) SetShape(shape common.Rectangle)
- func (e *Map) SetText(text string)
- func (e *Map) SetVisible(isVisible bool)
- func (e *Map) Shape() *common.Rectangle
- func (e *Map) TileX(x float64) int
- func (e *Map) TileY(y float64) int
- func (e *Map) Update(dt float64)
- func (e *Map) X() float64
- func (e *Map) Y() float64
- type MapCollider
- type MapData
- type MapLayer
- type MapTile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map represents a UI Map element.
func (*Map) IsDestroyed ¶
IsDestroyed returns true when the element is flagged for deletion
func (*Map) LerpPosition ¶
func (e *Map) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func())
LerpPosition changes an element's position over duration
func (*Map) RenderIndex ¶
RenderIndex returns the render index of element
func (*Map) SetEnabled ¶
SetEnabled changes if a map is enabled
func (*Map) SetIsDestroyed ¶
SetIsDestroyed sets an element to be destroyed on next update
func (*Map) SetOnPressFunction ¶
func (e *Map) SetOnPressFunction(f func())
SetOnPressFunction lets you pass a function without the need of map handling
func (*Map) SetRenderIndex ¶
SetRenderIndex sets the render index of element
func (*Map) SetVisible ¶
SetVisible changes the visibility of a map
type MapCollider ¶
type MapCollider struct { IsCollider bool `json:"is_collider,omitempty"` Cost float32 `json:"cost,omitempty"` }
MapCollider is a boolean if a collider is true or not
type MapData ¶
type MapData struct { Source string `json:"source,omitempty"` Width int64 `json:"width,omitempty"` Height int64 `json:"height,omitempty"` TileWidth int64 `json:"tile_width,omitempty"` TileHeight int64 `json:"tile_height,omitempty"` TileCount int64 `json:"tile_count,omitempty"` TileSheetWidth int64 TileSheetHeight int64 TileFrames []image.Rectangle Layers []MapLayer `json:"layers,omitempty"` Colliders []MapCollider `json:"colliders,omitempty"` }
MapData contains map related information
type MapLayer ¶
type MapLayer struct { Name string `json:"name,omitempty"` Opacity float32 `json:"opacity,omitempty"` Tiles []MapTile `json:"tiles,omitempty"` }
MapLayer contains layer data
Click to show internal directories.
Click to hide internal directories.