ebitencanvas

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Water color.RGBA = color.RGBA{0x23, 0x89, 0xDA, 0xFF} // 2389DA
	Black color.RGBA = color.RGBA{0x00, 0x00, 0x00, 0xFF}
	Red   color.RGBA = color.RGBA{0xFF, 0x00, 0x00, 0xFF}
)

Functions

func NewSprite added in v0.2.0

func NewSprite() *spriteToDraw

Create a new sprite. Default to the turtle image and invisible.

func StartEbitenTurtleCanvas

func StartEbitenTurtleCanvas(params CanvasParams, drawFunc func(turtlemodel.Canvas))

Start the Ebiten game. The drawFunc will be started as a go routine.

func TestEbitenTurtleCanvas added in v0.0.4

func TestEbitenTurtleCanvas(t *testing.T)

Types

type CanvasParams

type CanvasParams struct {
	Width   int  // pixels
	Height  int  // pixels
	ShowFPS bool // Show frame per second and other info in the top left corner.
}

Turtle Window creation parameters

type SavedControlState

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

Struct to hold ebiten key state information. It is used every frame during the update.

func (*SavedControlState) GetUserInput

func (s *SavedControlState) GetUserInput(screenWidth, screenHeight int) (pressed, justPressed *turtlemodel.UserInput)

Generate a new struct for pressed and just pressed. It should be read only to everyone else.

Jump to

Keyboard shortcuts

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