Documentation ¶
Overview ¶
Package ebiten contains an engine backend that uses ebiten. Enabled by default, disabled by the `headless` build tag
Index ¶
- type Animation
- type Asset
- type Atlas
- type Game
- func (g *Game) AddRenderer(renderer ...engine.Renderer)
- func (g *Game) Draw(screen *ebiten.Image)
- func (g Game) IsFocused() bool
- func (g Game) IsFullscreen() bool
- func (g Game) IsVsync() bool
- func (g *Game) Layout(ow, oh int) (int, int)
- func (c Game) NewAnimationFromAssetPath(path string) (engine.Animation, error)
- func (c Game) NewAssetFromPath(path string) (engine.Asset, error)
- func (c Game) NewAtlasFromAssetPath(path string) (engine.Atlas, error)
- func (c Game) NewCamera() engine.Camera
- func (c Game) NewCollider() engine.Collider
- func (c Game) NewImageFromAssetPath(path string) (engine.Image, error)
- func (c Game) NewImageFromImage(img image.Image) engine.Image
- func (c Game) NewImageFromPath(path string) (engine.Image, error)
- func (c Game) NewIsoRenderer() engine.IsoRenderer
- func (c Game) NewRenderer() engine.Renderer
- func (c Game) NewSoundFromAssetPath(path string) (engine.Sound, error)
- func (c Game) NewTextImage(txt string, w, h int, face font.Face, clr color.Color) engine.Image
- func (c Game) NewTilemap(width int, data [2][][]int, mapper map[int]engine.Image, ...) engine.Tilemap
- func (g *Game) Run() error
- func (g Game) SetFullscreen(v bool)
- func (g Game) SetVsync(v bool)
- func (g *Game) Update() error
- type Image
- func (i *Image) Alpha(alpha float64)
- func (i *Image) Class() string
- func (i *Image) Dispose()
- func (i *Image) IsDisposed() bool
- func (i *Image) IsRenderable() bool
- func (i *Image) Offset(x, y float64)
- func (i *Image) Origin(x, y float64)
- func (i *Image) Position() engine.Vec2
- func (i *Image) Rotate(d float64)
- func (i *Image) RoundTranslations(round bool)
- func (i *Image) Scale(x, y float64)
- func (i *Image) SetRenderable(r bool)
- func (i *Image) SetZDepth(z int)
- func (i *Image) Size() (int, int)
- func (i *Image) Tint(r, g, b float64)
- func (i *Image) Translate(x, y float64)
- func (i *Image) TriggersTileOverlapEvent(triggers bool)
- func (i *Image) Undispose()
- type Input
- func (i *Input) CursorPosition() (int, int)
- func (i *Input) IsAnyKeyJustPressed() bool
- func (i *Input) IsAnyKeyPressed() bool
- func (i *Input) IsKeyJustPressed(k int) bool
- func (i *Input) IsKeyJustReleased(k int) bool
- func (i *Input) IsKeyPressed(k int) bool
- func (i *Input) IsMouseButtonJustPressed(k int) bool
- func (i *Input) IsMouseButtonJustReleased(k int) bool
- func (i *Input) IsMouseButtonPressed(k int) bool
- func (i *Input) SetCursorBounds(minX, minY, maxX, maxY int)
- func (i *Input) SetCursorMode(mode engine.CursorMode)
- type IsoRenderer
- type Renderer
- type Sound
- type SoundControl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct { Image // contains filtered or unexported fields }
Animation is an engine.Animation.
func (*Animation) SetTickCount ¶
SetTickCount implements engine.Animation.
type Asset ¶
type Asset struct {
// contains filtered or unexported fields
}
Asset is an engine.Asset.
func (*Asset) ToAnimation ¶
ToAnimation implements the ToAnimation method of engine.Asset.
func (*Asset) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type Atlas ¶
type Atlas struct {
// contains filtered or unexported fields
}
Atlas is an engine.Atlas.
type Game ¶
type Game struct { Input *SoundControl // contains filtered or unexported fields }
Game is an ebiten implementation of engine.Game.
func NewGame ¶
func NewGame( title string, w, h int, flags byte, tickFunc func(), layoutFunc func(int, int) (int, int), ) *Game
NewGame returns an instantiated game.
func (*Game) AddRenderer ¶
AddRenderer adds a renderer to the draw stack.
func (Game) IsFullscreen ¶
IsFullscreen returns the fullscreen state of the game.
func (Game) NewAnimationFromAssetPath ¶
func (Game) NewAtlasFromAssetPath ¶
func (Game) NewCollider ¶
func (Game) NewImageFromAssetPath ¶
func (Game) NewIsoRenderer ¶
func (c Game) NewIsoRenderer() engine.IsoRenderer
func (Game) NewRenderer ¶
func (Game) NewSoundFromAssetPath ¶
func (Game) NewTextImage ¶
func (Game) NewTilemap ¶
func (Game) SetFullscreen ¶
SetFullscreen sets the fullscreen state of the game.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is an ebiten implementation of engine.Image.
func (*Image) IsDisposed ¶
IsDisposed indicates if the image has been dispoed.
func (*Image) IsRenderable ¶
IsRenderable returns the render state of the image.
func (*Image) RoundTranslations ¶
RoundTranslations sets whether or not image translations will be rounded during rendering.
func (*Image) SetRenderable ¶
SetRenderable sets the render state of the image.
func (*Image) TriggersTileOverlapEvent ¶
TriggersTileOverlapEvent determines whether or not the tile overlap event will occur when this image is behind a tile in the isometric renderer.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is an engine.Input.
func (*Input) CursorPosition ¶
CursorPosition implements engine.Input.
func (*Input) IsAnyKeyJustPressed ¶
IsAnyKeyJustPressed implements engine.Input.
func (*Input) IsAnyKeyPressed ¶
IsAnyKeyPressed implements engine.Input.
func (*Input) IsKeyJustPressed ¶
IsKeyJustPressed implements engine.Input.
func (*Input) IsKeyJustReleased ¶
IsKeyJustReleased implements engine.Input.
func (*Input) IsKeyPressed ¶
IsKeyPressed implements engine.Input.
func (*Input) IsMouseButtonJustPressed ¶
IsMouseButtonJustPressed implements engine.Input.
func (*Input) IsMouseButtonJustReleased ¶
IsMouseButtonJustReleased implements engine.Input.
func (*Input) IsMouseButtonPressed ¶
IsMouseButtonPressed implements engine.Input.
func (*Input) SetCursorBounds ¶
SetCursorBounds implements engine.Input.
func (*Input) SetCursorMode ¶
func (i *Input) SetCursorMode(mode engine.CursorMode)
SetCursorMode implements engine.Input.
type IsoRenderer ¶
type IsoRenderer struct { Renderer // contains filtered or unexported fields }
IsoRenderer is an engine.IsoRenderer.
func NewIsoRenderer ¶
func NewIsoRenderer() *IsoRenderer
NewIsoRenderer creates an empty IsoRenderer.
func (*IsoRenderer) SetTilemap ¶
func (r *IsoRenderer) SetTilemap(tilemap engine.Tilemap)
SetTilemap implements engine.IsoRenderer.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is a simple ebiten renderer.
func (*Renderer) ScreenToWorld ¶
ScreenToWorld implements engine.Renderer.
func (*Renderer) SetViewport ¶
SetViewport implements engine.Renderer.
type Sound ¶
type Sound struct {
// contains filtered or unexported fields
}
Sound is an ebiten implementation of engine.Sound.
type SoundControl ¶
type SoundControl struct {
// contains filtered or unexported fields
}
SoundControl is an ebiten implementation of engine.SoundControl.
func NewSoundControl ¶
func NewSoundControl() *SoundControl
NewSoundControl returns an instantiated *SoundControl.
func (*SoundControl) SetVolume ¶
func (sc *SoundControl) SetVolume(group string, v float64)
SetVolume implements the SetVolume method of engine.SoundControl.
func (*SoundControl) Volume ¶
func (sc *SoundControl) Volume(group string) (v float64)
Volume implements the Volume method of engine.SoundControl.