mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
examples/additive: Refactoring
This commit is contained in:
parent
96c5621879
commit
a6a1c51df7
@ -38,17 +38,24 @@ func update(screen *ebiten.Image) error {
|
||||
if ebiten.IsRunningSlowly() {
|
||||
return nil
|
||||
}
|
||||
w, _ := ebitenImage.Size()
|
||||
const ox = 10
|
||||
const oy = 10
|
||||
|
||||
const (
|
||||
ox = 10
|
||||
oy = 10
|
||||
)
|
||||
|
||||
screen.Fill(color.NRGBA{0x00, 0x40, 0x80, 0xff})
|
||||
|
||||
op := &ebiten.DrawImageOptions{}
|
||||
op.GeoM.Translate(ox, oy)
|
||||
screen.DrawImage(ebitenImage, op)
|
||||
|
||||
op = &ebiten.DrawImageOptions{}
|
||||
w, _ := ebitenImage.Size()
|
||||
op.GeoM.Translate(ox+float64(w), oy)
|
||||
op.CompositeMode = ebiten.CompositeModeLighter
|
||||
screen.DrawImage(ebitenImage, op)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user