mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +01:00
examples/minify: reorder renderings
This commit is contained in:
parent
d3b83dd4ea
commit
9b7328442b
@ -66,11 +66,6 @@ func (g *Game) Update() error {
|
|||||||
|
|
||||||
func (g *Game) Draw(screen *ebiten.Image) {
|
func (g *Game) Draw(screen *ebiten.Image) {
|
||||||
s := 1.5 / math.Pow(1.01, float64(g.counter))
|
s := 1.5 / math.Pow(1.01, float64(g.counter))
|
||||||
msg := fmt.Sprintf(`Minifying images (Nearest filter vs Linear filter):
|
|
||||||
Press R to rotate the images.
|
|
||||||
Press C to clip the images.
|
|
||||||
Scale: %0.2f`, s)
|
|
||||||
ebitenutil.DebugPrint(screen, msg)
|
|
||||||
|
|
||||||
clippedGophersImage := gophersImage.SubImage(image.Rect(100, 100, 200, 200)).(*ebiten.Image)
|
clippedGophersImage := gophersImage.SubImage(image.Rect(100, 100, 200, 200)).(*ebiten.Image)
|
||||||
for i, f := range []ebiten.Filter{ebiten.FilterNearest, ebiten.FilterLinear} {
|
for i, f := range []ebiten.Filter{ebiten.FilterNearest, ebiten.FilterLinear} {
|
||||||
@ -91,6 +86,12 @@ Scale: %0.2f`, s)
|
|||||||
screen.DrawImage(gophersImage, op)
|
screen.DrawImage(gophersImage, op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg := fmt.Sprintf(`Minifying images (Nearest filter vs Linear filter):
|
||||||
|
Press R to rotate the images.
|
||||||
|
Press C to clip the images.
|
||||||
|
Scale: %0.2f`, s)
|
||||||
|
ebitenutil.DebugPrint(screen, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user