mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: add comments at DrawTriangles
This commit is contained in:
parent
a0e1d08123
commit
b1bcbbeeea
@ -31,6 +31,9 @@ import (
|
||||
|
||||
var (
|
||||
emptyImage = ebiten.NewImage(3, 3)
|
||||
|
||||
// emptySubImage is an internal sub image of emptyImage.
|
||||
// Use emptySubImage at DrawTriangles instead of emptyImage in order to avoid bleeding edges.
|
||||
emptySubImage = emptyImage.SubImage(image.Rect(1, 1, 2, 2)).(*ebiten.Image)
|
||||
)
|
||||
|
||||
|
5
image.go
5
image.go
@ -276,6 +276,11 @@ const MaxIndicesNum = graphics.IndicesNum
|
||||
|
||||
// DrawTriangles draws triangles with the specified vertices and their indices.
|
||||
//
|
||||
// img is used as a source image. img cannot be nil.
|
||||
// If you want to draw triangles with a solid color, use a small white image
|
||||
// and adjust the color elements in the vertices. For an actual implementation,
|
||||
// see the example 'vector'.
|
||||
//
|
||||
// Vertex contains color values, which are interpreted as straight-alpha colors.
|
||||
//
|
||||
// If len(indices) is not multiple of 3, DrawTriangles panics.
|
||||
|
Loading…
Reference in New Issue
Block a user