From a36ea971b4cb66d99d660057270f77e0423fe1b5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 12 Mar 2018 03:18:07 +0900 Subject: [PATCH] examples/airship: Improve z values --- examples/airship/main.go | 6 +++--- image.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/airship/main.go b/examples/airship/main.go index 6ff38d515..5f0e37f74 100644 --- a/examples/airship/main.go +++ b/examples/airship/main.go @@ -195,12 +195,12 @@ func drawGroundImage(screen *ebiten.Image, ground *ebiten.Image) { gw, _ := ground.Size() pw, ph := perspectiveGroundImage.Size() for j := 0; j < ph; j++ { - // z is in [1.5, 0.01] + // z is in [1, -1] rate := float64(j) / float64(ph) - z := (1-rate)*1.5 + rate*0.01 + z := (1-rate)*1 + rate*-1 op := &ebiten.DrawImageOptions{} op.GeoM.Translate(-float64(pw)/2, 0) - op.GeoM.Scale(1/z, 4) // 4 is an arbitrary number not to make empty lines. + op.GeoM.Scale(1/z, 8) // 8 is an arbitrary number not to make empty lines. op.GeoM.Translate(float64(pw)/2, float64(j)/z) src := image.Rect(0, j, gw, j+1) diff --git a/image.go b/image.go index 974e2da48..0b44345c5 100644 --- a/image.go +++ b/image.go @@ -439,6 +439,8 @@ func newImageWithScreenFramebuffer(width, height int) *Image { return i } +var GuaranteedMaxImageSize = 4096 + // MaxImageSize is deprecated as of 1.7.0-alpha. No replacement so far. // // TODO: Make this replacement (#541)