mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
graphics: Add explanation to SourceRect
This commit is contained in:
parent
96402c11a2
commit
ee7ef75b8b
10
image.go
10
image.go
@ -308,6 +308,16 @@ type DrawImageOptions struct {
|
||||
// If SourceRect is nil, whole image is used.
|
||||
//
|
||||
// It is assured that texels out of the SourceRect are never used.
|
||||
//
|
||||
// Calling DrawImage copies the content of SourceRect pointer. This means that
|
||||
// even if the SourceRect value is modified after passed to DrawImage,
|
||||
// the result of DrawImage doen't change.
|
||||
//
|
||||
// op := &ebiten.DrawImageOptions{}
|
||||
// r := image.Rect(0, 0, 100, 100)
|
||||
// op.SourceRect = &r
|
||||
// dst.DrawImage(src, op)
|
||||
// r.Min.X = 10 // This doesn't affect the previous DrawImage.
|
||||
SourceRect *image.Rectangle
|
||||
|
||||
// GeoM is a geometry matrix to draw.
|
||||
|
Loading…
Reference in New Issue
Block a user