mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Rename At -> DrawImageAt
This commit is contained in:
parent
f2fbd991d2
commit
cdc84567ca
@ -59,7 +59,7 @@ func (d *debugPrintState) drawText(rt *ebiten.Image, str string, x, y int, c col
|
|||||||
b := float64(cc.B) / math.MaxUint16
|
b := float64(cc.B) / math.MaxUint16
|
||||||
a := float64(cc.A) / math.MaxUint16
|
a := float64(cc.A) / math.MaxUint16
|
||||||
clr := ebiten.ScaleColor(r, g, b, a)
|
clr := ebiten.ScaleColor(r, g, b, a)
|
||||||
op := ebiten.At(x+1, y)
|
op := ebiten.DrawImageAt(x+1, y)
|
||||||
op.DstParts = dsts
|
op.DstParts = dsts
|
||||||
op.SrcParts = srcs
|
op.SrcParts = srcs
|
||||||
op.ColorMatrix = &clr
|
op.ColorMatrix = &clr
|
||||||
|
@ -50,7 +50,7 @@ func update(screen *ebiten.Image) error {
|
|||||||
}
|
}
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
clr := ebiten.ScaleColor(1.0, 1.0, 1.0, 0.5)
|
clr := ebiten.ScaleColor(1.0, 1.0, 1.0, 0.5)
|
||||||
op := ebiten.At(15+int(float64(i)*diff), 20)
|
op := ebiten.DrawImageAt(15+int(float64(i)*diff), 20)
|
||||||
op.ColorMatrix = &clr
|
op.ColorMatrix = &clr
|
||||||
if err := tmpRenderTarget.DrawImage(ebitenImage, op); err != nil {
|
if err := tmpRenderTarget.DrawImage(ebitenImage, op); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -59,7 +59,7 @@ func update(screen *ebiten.Image) error {
|
|||||||
|
|
||||||
screen.Fill(color.NRGBA{0x00, 0x00, 0x80, 0xff})
|
screen.Fill(color.NRGBA{0x00, 0x00, 0x80, 0xff})
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
op := ebiten.At(0, int(float64(i)*diff))
|
op := ebiten.DrawImageAt(0, int(float64(i)*diff))
|
||||||
if err := screen.DrawImage(tmpRenderTarget, op); err != nil {
|
if err := screen.DrawImage(tmpRenderTarget, op); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ func drawBlocks(r *ebiten.Image, images *Images, blocks [][]BlockType, x, y int)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
blocksImage := images.GetImage("blocks")
|
blocksImage := images.GetImage("blocks")
|
||||||
op := ebiten.At(x, y)
|
op := ebiten.DrawImageAt(x, y)
|
||||||
op.SrcParts = srcs
|
op.SrcParts = srcs
|
||||||
op.DstParts = dsts
|
op.DstParts = dsts
|
||||||
r.DrawImage(blocksImage, op)
|
r.DrawImage(blocksImage, op)
|
||||||
|
@ -66,7 +66,7 @@ func drawTitleBackground(r *ebiten.Image, images *Images, c int) {
|
|||||||
|
|
||||||
dx := (-c / 4) % imageWidth
|
dx := (-c / 4) % imageWidth
|
||||||
dy := (c / 4) % imageHeight
|
dy := (c / 4) % imageHeight
|
||||||
op := ebiten.At(dx, dy)
|
op := ebiten.DrawImageAt(dx, dy)
|
||||||
op.SrcParts = srcs
|
op.SrcParts = srcs
|
||||||
op.DstParts = dsts
|
op.DstParts = dsts
|
||||||
r.DrawImage(backgroundImage, op)
|
r.DrawImage(backgroundImage, op)
|
||||||
|
@ -45,7 +45,7 @@ func Update(screen *ebiten.Image) error {
|
|||||||
clr := ebiten.ScaleColor(1.0, 0.25, 0.25, 1.0)
|
clr := ebiten.ScaleColor(1.0, 0.25, 0.25, 1.0)
|
||||||
theta := 2.0 * math.Pi * float64(count%60) / 60.0
|
theta := 2.0 * math.Pi * float64(count%60) / 60.0
|
||||||
clr.Concat(ebiten.RotateHue(theta))
|
clr.Concat(ebiten.RotateHue(theta))
|
||||||
op := ebiten.At(mx, my)
|
op := ebiten.DrawImageAt(mx, my)
|
||||||
op.ColorMatrix = &clr
|
op.ColorMatrix = &clr
|
||||||
canvasRenderTarget.DrawImage(brushRenderTarget, op)
|
canvasRenderTarget.DrawImage(brushRenderTarget, op)
|
||||||
}
|
}
|
||||||
|
2
image.go
2
image.go
@ -209,7 +209,7 @@ type DrawImageOptions struct {
|
|||||||
ColorMatrix *ColorMatrix
|
ColorMatrix *ColorMatrix
|
||||||
}
|
}
|
||||||
|
|
||||||
func At(x, y int) *DrawImageOptions {
|
func DrawImageAt(x, y int) *DrawImageOptions {
|
||||||
geo := TranslateGeometry(float64(x), float64(y))
|
geo := TranslateGeometry(float64(x), float64(y))
|
||||||
return &DrawImageOptions{
|
return &DrawImageOptions{
|
||||||
GeometryMatrix: &geo,
|
GeometryMatrix: &geo,
|
||||||
|
Loading…
Reference in New Issue
Block a user