mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
490155583f
commit
9787e076bc
8
image.go
8
image.go
@ -811,6 +811,10 @@ func (i *Image) ReplacePixels(pixels []byte) {
|
||||
//
|
||||
// If width or height is less than 1 or more than device-dependent maximum size, NewImage panics.
|
||||
//
|
||||
// NewImage should be called only when necessary.
|
||||
// For example, you should avoid to call NewImage every Update or Draw call.
|
||||
// Reusing the same image by Clear is much more efficient than creating a new image.
|
||||
//
|
||||
// NewImage panics if RunGame already finishes.
|
||||
func NewImage(width, height int) *Image {
|
||||
if isRunGameEnded() {
|
||||
@ -834,6 +838,10 @@ func NewImage(width, height int) *Image {
|
||||
//
|
||||
// If source's width or height is less than 1 or more than device-dependent maximum size, NewImageFromImage panics.
|
||||
//
|
||||
// NewImageFromImage should be called only when necessary.
|
||||
// For example, you should avoid to call NewImageFromImage every Update or Draw call.
|
||||
// Reusing the same image by Clear is much more efficient than creating a new image.
|
||||
//
|
||||
// NewImageFromImage panics if RunGame already finishes.
|
||||
func NewImageFromImage(source image.Image) *Image {
|
||||
if isRunGameEnded() {
|
||||
|
Loading…
Reference in New Issue
Block a user