mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: typo
This commit is contained in:
parent
371f369a9f
commit
f923250a65
16
image.go
16
image.go
@ -323,7 +323,7 @@ type Vertex struct {
|
|||||||
|
|
||||||
// SrcX and SrcY represents a point on a source image.
|
// SrcX and SrcY represents a point on a source image.
|
||||||
// Be careful that SrcX/SrcY coordinates are on the image's bounds.
|
// Be careful that SrcX/SrcY coordinates are on the image's bounds.
|
||||||
// This means that a left-upper point of a sub-image might not be (0, 0).
|
// This means that a upper-left point of a sub-image might not be (0, 0).
|
||||||
SrcX float32
|
SrcX float32
|
||||||
SrcY float32
|
SrcY float32
|
||||||
|
|
||||||
@ -615,8 +615,8 @@ func (i *Image) DrawTrianglesShader(vertices []Vertex, indices []uint16, shader
|
|||||||
}
|
}
|
||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||||
// (sx, sy) is the left-upper position of the first image.
|
// (sx, sy) is the upper-left position of the first image.
|
||||||
// Calculate the distance between the current image's left-upper position and the first one's.
|
// Calculate the distance between the current image's upper-left position and the first one's.
|
||||||
offsets[i][0] = float32(x - sx)
|
offsets[i][0] = float32(x - sx)
|
||||||
offsets[i][1] = float32(y - sy)
|
offsets[i][1] = float32(y - sy)
|
||||||
}
|
}
|
||||||
@ -717,8 +717,8 @@ func (i *Image) DrawRectShader(width, height int, shader *Shader, options *DrawR
|
|||||||
}
|
}
|
||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||||
// (sx, sy) is the left-upper position of the first image.
|
// (sx, sy) is the upper-left position of the first image.
|
||||||
// Calculate the distance between the current image's left-upper position and the first one's.
|
// Calculate the distance between the current image's upper-left position and the first one's.
|
||||||
offsets[i][0] = float32(x - sx)
|
offsets[i][0] = float32(x - sx)
|
||||||
offsets[i][1] = float32(y - sy)
|
offsets[i][1] = float32(y - sy)
|
||||||
}
|
}
|
||||||
@ -986,7 +986,7 @@ type NewImageOptions struct {
|
|||||||
//
|
//
|
||||||
// The rendering origin position is (0, 0) of the given bounds.
|
// The rendering origin position is (0, 0) of the given bounds.
|
||||||
// If DrawImage is called on a new image created by NewImageOptions,
|
// If DrawImage is called on a new image created by NewImageOptions,
|
||||||
// for example, the center of scaling and rotating is (0, 0), that might not be a left-upper position.
|
// for example, the center of scaling and rotating is (0, 0), that might not be a upper-left position.
|
||||||
//
|
//
|
||||||
// If options is nil, the default setting is used.
|
// If options is nil, the default setting is used.
|
||||||
//
|
//
|
||||||
@ -1034,7 +1034,7 @@ func newImage(bounds image.Rectangle, imageType atlas.ImageType) *Image {
|
|||||||
//
|
//
|
||||||
// NewImageFromImage panics if RunGame already finishes.
|
// NewImageFromImage panics if RunGame already finishes.
|
||||||
//
|
//
|
||||||
// The returned image's left-upper position is always (0, 0). The source's bounds are not respected.
|
// The returned image's upper-left position is always (0, 0). The source's bounds are not respected.
|
||||||
func NewImageFromImage(source image.Image) *Image {
|
func NewImageFromImage(source image.Image) *Image {
|
||||||
return NewImageFromImageWithOptions(source, nil)
|
return NewImageFromImageWithOptions(source, nil)
|
||||||
}
|
}
|
||||||
@ -1050,7 +1050,7 @@ type NewImageFromImageOptions struct {
|
|||||||
Unmanaged bool
|
Unmanaged bool
|
||||||
|
|
||||||
// PreserveBounds represents whether the new image's bounds are the same as the given image.
|
// PreserveBounds represents whether the new image's bounds are the same as the given image.
|
||||||
// The default (zero) value is false, that means the new image's left-upper position is adjusted to (0, 0).
|
// The default (zero) value is false, that means the new image's upper-left position is adjusted to (0, 0).
|
||||||
PreserveBounds bool
|
PreserveBounds bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ var textM sync.Mutex
|
|||||||
// (x, y) represents a 'dot' (period) position.
|
// (x, y) represents a 'dot' (period) position.
|
||||||
// This means that if the given text consisted of a single character ".",
|
// This means that if the given text consisted of a single character ".",
|
||||||
// it would be positioned at the given position (x, y).
|
// it would be positioned at the given position (x, y).
|
||||||
// Be careful that this doesn't represent left-upper corner position.
|
// Be careful that this doesn't represent upper-left corner position.
|
||||||
//
|
//
|
||||||
// clr is the color for text rendering.
|
// clr is the color for text rendering.
|
||||||
//
|
//
|
||||||
@ -190,7 +190,7 @@ func Draw(dst *ebiten.Image, text string, face font.Face, x, y int, clr color.Co
|
|||||||
// face is the font for text rendering.
|
// face is the font for text rendering.
|
||||||
// op is the options to draw glyph images.
|
// op is the options to draw glyph images.
|
||||||
// The origin point is a 'dot' (period) position.
|
// The origin point is a 'dot' (period) position.
|
||||||
// Be careful that the origin point is not left-upper corner position of dst.
|
// Be careful that the origin point is not upper-left corner position of dst.
|
||||||
// The default glyph color is while. op's ColorM adjusts the color.
|
// The default glyph color is while. op's ColorM adjusts the color.
|
||||||
//
|
//
|
||||||
// If you want to adjust the position of the text, these functions are useful:
|
// If you want to adjust the position of the text, these functions are useful:
|
||||||
|
@ -131,7 +131,7 @@ func SetWindowIcon(iconImages []image.Image) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WindowPosition returns the window position.
|
// WindowPosition returns the window position.
|
||||||
// The origin position is the left-upper corner of the current monitor.
|
// The origin position is the upper-left corner of the current monitor.
|
||||||
// The unit is device-independent pixels.
|
// The unit is device-independent pixels.
|
||||||
//
|
//
|
||||||
// WindowPosition panics if the main loop does not start yet.
|
// WindowPosition panics if the main loop does not start yet.
|
||||||
@ -146,7 +146,7 @@ func WindowPosition() (x, y int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetWindowPosition sets the window position.
|
// SetWindowPosition sets the window position.
|
||||||
// The origin position is the left-upper corner of the current monitor.
|
// The origin position is the upper-left corner of the current monitor.
|
||||||
// The unit is device-independent pixels.
|
// The unit is device-independent pixels.
|
||||||
//
|
//
|
||||||
// SetWindowPosition sets the original window position in fullscreen mode.
|
// SetWindowPosition sets the original window position in fullscreen mode.
|
||||||
|
Loading…
Reference in New Issue
Block a user