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
c94deb1ddb
commit
670ba4ffe4
16
image.go
16
image.go
@ -323,7 +323,7 @@ type Vertex struct {
|
||||
|
||||
// SrcX and SrcY represents a point on a source image.
|
||||
// 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
|
||||
SrcY float32
|
||||
|
||||
@ -615,8 +615,8 @@ func (i *Image) DrawTrianglesShader(vertices []Vertex, indices []uint16, shader
|
||||
}
|
||||
b := img.Bounds()
|
||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||
// (sx, sy) is the left-upper position of the first image.
|
||||
// Calculate the distance between the current image's left-upper position and the first one's.
|
||||
// (sx, sy) is the upper-left position of the first image.
|
||||
// Calculate the distance between the current image's upper-left position and the first one's.
|
||||
offsets[i][0] = float32(x - sx)
|
||||
offsets[i][1] = float32(y - sy)
|
||||
}
|
||||
@ -717,8 +717,8 @@ func (i *Image) DrawRectShader(width, height int, shader *Shader, options *DrawR
|
||||
}
|
||||
b := img.Bounds()
|
||||
x, y := img.adjustPosition(b.Min.X, b.Min.Y)
|
||||
// (sx, sy) is the left-upper position of the first image.
|
||||
// Calculate the distance between the current image's left-upper position and the first one's.
|
||||
// (sx, sy) is the upper-left position of the first image.
|
||||
// Calculate the distance between the current image's upper-left position and the first one's.
|
||||
offsets[i][0] = float32(x - sx)
|
||||
offsets[i][1] = float32(y - sy)
|
||||
}
|
||||
@ -986,7 +986,7 @@ type NewImageOptions struct {
|
||||
//
|
||||
// The rendering origin position is (0, 0) of the given bounds.
|
||||
// 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.
|
||||
//
|
||||
@ -1034,7 +1034,7 @@ func newImage(bounds image.Rectangle, imageType atlas.ImageType) *Image {
|
||||
//
|
||||
// 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 {
|
||||
return NewImageFromImageWithOptions(source, nil)
|
||||
}
|
||||
@ -1050,7 +1050,7 @@ type NewImageFromImageOptions struct {
|
||||
Unmanaged bool
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ var textM sync.Mutex
|
||||
// (x, y) represents a 'dot' (period) position.
|
||||
// This means that if the given text consisted of a single character ".",
|
||||
// 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.
|
||||
//
|
||||
@ -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.
|
||||
// op is the options to draw glyph images.
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
// 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.
|
||||
//
|
||||
// WindowPosition panics if the main loop does not start yet.
|
||||
@ -146,7 +146,7 @@ func WindowPosition() (x, y int) {
|
||||
}
|
||||
|
||||
// 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.
|
||||
//
|
||||
// SetWindowPosition sets the original window position in fullscreen mode.
|
||||
|
Loading…
Reference in New Issue
Block a user