Documentation
¶
Index ¶
- Variables
- func Debug() bool
- func SetDebug(debug bool)
- func SetPlayer(s *Sprite)
- func SetProject(p *Project)
- func SetRoom(r *Room, loc *image.Point)
- func SetViewport(width int, height int)
- type Frame
- type Image
- type Project
- func (p *Project) Load(fileSystem fs.FS) error
- func (p *Project) LoadImage(path string) (*Image, error)
- func (p *Project) NewFrame(name string, img *Image) *Frame
- func (p *Project) NewRoom(name string) *Room
- func (p *Project) NewSprite(name string, f *Frame) *Sprite
- func (p *Project) Save(path string) error
- func (p *Project) SetLocalDir(dir string)
- type Room
- type Sprite
- type SpriteAnimation
- type Viewport
Constants ¶
This section is empty.
Variables ¶
View Source
var G = newGame()
View Source
var GV = G.V
Functions ¶
func SetProject ¶
func SetProject(p *Project)
func SetViewport ¶
Types ¶
type Frame ¶
type Frame struct { Image *Image FlipH, FlipV bool `json:",omitempty"` Rect *image.Rectangle `json:",omitempty"` // contains filtered or unexported fields }
func (*Frame) MarshalJSON ¶
func (*Frame) SetSubImage ¶
func (*Frame) UnmarshalJSON ¶
type Image ¶
type Image struct { Image *ebiten.Image // contains filtered or unexported fields }
func (*Image) MarshalJSON ¶
type Project ¶
type Project struct { Name string About string Author string Website string Width int Height int TPS int Images map[string]*Image `json:"-"` Frames map[string]*Frame `json:"-"` Sprites map[string]*Sprite `json:"-"` Rooms map[string]*Room `json:"-"` // contains filtered or unexported fields }
Project represents all metadata and assets related to a game.
func LoadProject ¶
func (*Project) SetLocalDir ¶
type Room ¶
type Room struct { BGColor color.RGBA `json:",omitempty"` // Background color. BGSprite *Sprite `json:",omitempty"` // Background sprite. Sprites []*Sprite `json:",omitempty"` Spawn *image.Point // contains filtered or unexported fields }
func (*Room) MarshalJSON ¶
func (*Room) UnmarshalJSON ¶
type Sprite ¶
type Sprite struct { Name string `json:"-"` X, Y int Original *Frame Animations []SpriteAnimation // contains filtered or unexported fields }
func (*Sprite) MarshalJSON ¶
func (*Sprite) SetAnimation ¶
func (*Sprite) SetAnimations ¶
func (s *Sprite) SetAnimations(a []SpriteAnimation)
func (*Sprite) UnmarshalJSON ¶
type SpriteAnimation ¶
func NewSpriteAnimation ¶
func NewSpriteAnimation(name string) SpriteAnimation
Source Files
¶
Click to show internal directories.
Click to hide internal directories.