mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
fd41042dcb
commit
19d6f8d20a
@ -39,8 +39,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
|
||||
sampleRate = 22050
|
||||
)
|
||||
@ -81,7 +81,7 @@ type Player struct {
|
||||
}
|
||||
|
||||
func playerBarRect() (x, y, w, h int) {
|
||||
w, h = 300, 4
|
||||
w, h = 600, 8
|
||||
x = (screenWidth - w) / 2
|
||||
y = screenHeight - h - 16
|
||||
return
|
||||
@ -239,7 +239,7 @@ func (p *Player) draw(screen *ebiten.Image) {
|
||||
|
||||
// Draw the cursor on the bar.
|
||||
c := p.current
|
||||
cw, ch := 4, 10
|
||||
cw, ch := 8, 20
|
||||
cx := int(time.Duration(w)*c/p.total) + x - cw/2
|
||||
cy := y - (ch-h)/2
|
||||
ebitenutil.DrawRect(screen, float64(cx), float64(cy), float64(cw), float64(ch), playerCurrentColor)
|
||||
@ -335,7 +335,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Audio (Ebiten Demo)")
|
||||
g, err := NewGame()
|
||||
if err != nil {
|
||||
|
@ -30,8 +30,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 22050
|
||||
|
||||
introLengthInSecond = 5
|
||||
@ -90,7 +90,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Audio Infinite Loop (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -35,8 +35,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 22050
|
||||
)
|
||||
|
||||
@ -135,7 +135,7 @@ func main() {
|
||||
}
|
||||
img = ebiten.NewImageFromImage(rawimg)
|
||||
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Audio Panning Loop (Ebiten Demo)")
|
||||
g := &Game{}
|
||||
if err := ebiten.RunGame(g); err != nil {
|
||||
|
@ -32,8 +32,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
const (
|
||||
@ -263,7 +263,7 @@ func main() {
|
||||
}
|
||||
g.world = ebiten.NewImage(worldWidth, worldHeight)
|
||||
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Tiles (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(g); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -36,8 +36,8 @@ func init() {
|
||||
}
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
// Sprite represents an image.
|
||||
@ -316,7 +316,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Drag & Drop (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(NewGame()); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -28,8 +28,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
var (
|
||||
@ -113,7 +113,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Paint (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 44100
|
||||
)
|
||||
|
||||
@ -158,7 +158,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("PCM (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
var (
|
||||
@ -84,7 +84,7 @@ func main() {
|
||||
}
|
||||
gophersImage = ebiten.NewImageFromImage(img)
|
||||
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Perspective (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 44100
|
||||
frequency = 440
|
||||
)
|
||||
@ -113,7 +113,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Sine Wave (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&Game{}); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -26,8 +26,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
// repeatingKeyPressed return true when key is pressed considering the repeat state.
|
||||
@ -98,7 +98,7 @@ func main() {
|
||||
counter: 0,
|
||||
}
|
||||
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("TypeWriter (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(g); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -29,8 +29,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 44100
|
||||
)
|
||||
|
||||
@ -96,7 +96,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("WAV (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(&g); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -25,15 +25,15 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
|
||||
)
|
||||
|
||||
var pointerImage = ebiten.NewImage(4, 4)
|
||||
var pointerImage = ebiten.NewImage(8, 8)
|
||||
|
||||
func init() {
|
||||
pointerImage.Fill(color.RGBA{0xff, 0, 0, 0xff})
|
||||
}
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
)
|
||||
|
||||
type Game struct {
|
||||
@ -65,7 +65,7 @@ func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
func main() {
|
||||
g := &Game{x: 0.0, y: 0.0}
|
||||
|
||||
ebiten.SetWindowSize(screenWidth*2, screenHeight*2)
|
||||
ebiten.SetWindowSize(screenWidth, screenHeight)
|
||||
ebiten.SetWindowTitle("Wheel (Ebiten Demo)")
|
||||
if err := ebiten.RunGame(g); err != nil {
|
||||
log.Fatal(err)
|
||||
|
Loading…
Reference in New Issue
Block a user