Documentation ¶
Index ¶
- Variables
- func DefaultLayoutF(gb *GameBase, outsideWidth, outsideHeight int) (width, height int)
- type GameBase
- func (gb *GameBase) Draw(screen *ebiten.Image)
- func (gb *GameBase) GetCurrentScene() interfaces.IScene
- func (gb *GameBase) GetDebugMode() bool
- func (gb *GameBase) GetRunSide() interfaces.RunSide
- func (gb *GameBase) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (gb *GameBase) Run(windowSizeX int, windowSizeY int, title string) error
- func (gb *GameBase) RunAsMobile()
- func (gb *GameBase) SetDebugMode(debugMode bool)
- func (gb *GameBase) SetScene(scene interfaces.IScene) error
- func (gb *GameBase) Update() error
- type LayoutF
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMainScene = errors.New("main scene isn't set up")
This error will be returned when main scene is not set up.
Functions ¶
func DefaultLayoutF ¶
Default implementation of the layout() function (required by ebitengine)
Types ¶
type GameBase ¶
type GameBase struct {
// contains filtered or unexported fields
}
Base for all the games. This defines main scene, current scene and layout() function that required by ebitengine.
func New ¶
func New(runSide interfaces.RunSide) *GameBase
Returns new instance of the GameBase. By default, current scene is nil. Make sure to set the main scene by using SetScene(...)!
func (*GameBase) GetCurrentScene ¶
func (gb *GameBase) GetCurrentScene() interfaces.IScene
Returns current showing scene.
func (*GameBase) GetDebugMode ¶
Returns true if debugging is enabled.
func (*GameBase) GetRunSide ¶
func (gb *GameBase) GetRunSide() interfaces.RunSide
Returns defined running side. Client \ Server \ Singleplayer.
func (*GameBase) RunAsMobile ¶
func (gb *GameBase) RunAsMobile()
func (*GameBase) SetDebugMode ¶
Changes the debug mode.
Click to show internal directories.
Click to hide internal directories.