mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
parent
8f08565488
commit
b5d8be96a6
@ -24,21 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// Game defines necessary functions for a mobile game.
|
||||
type Game interface {
|
||||
// Update updates a game by one frame.
|
||||
Update(*ebiten.Image) error
|
||||
|
||||
// Layout accepts a native view size in DP (device-independent pixels) and returns the game's logical screen
|
||||
// size.
|
||||
//
|
||||
// The screen scale is automatically adjusted to fit the view.
|
||||
//
|
||||
// Layout is called at an initialization and whenever the view size is changed.
|
||||
//
|
||||
// You can return a fixed screen size if you don't care, or you can also return a calculated screen size
|
||||
// adjusted with the given view size.
|
||||
Layout(viewWidth, viewHeight int) (screenWidth, screenHeight int)
|
||||
}
|
||||
type Game = ebiten.Game
|
||||
|
||||
// SetGame sets a mobile game.
|
||||
//
|
||||
|
19
run.go
19
run.go
@ -24,6 +24,25 @@ import (
|
||||
|
||||
var _ = __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__
|
||||
|
||||
// Game defines necessary functions for a game.
|
||||
//
|
||||
// Note: This interface is not used anywhere yet.
|
||||
type Game interface {
|
||||
// Update updates a game by one frame.
|
||||
Update(*Image) error
|
||||
|
||||
// Layout accepts a native outside size in DP (device-independent pixels) and returns the game's logical
|
||||
// screen size.
|
||||
//
|
||||
// The screen scale is automatically adjusted to fit the outside.
|
||||
//
|
||||
// Layout is called at an initialization and whenever the outside size is changed.
|
||||
//
|
||||
// You can return a fixed screen size if you don't care, or you can also return a calculated screen size
|
||||
// adjusted with the given outside size.
|
||||
Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
|
||||
}
|
||||
|
||||
// TPS represents a default ticks per second, that represents how many times game updating happens in a second.
|
||||
const DefaultTPS = 60
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user