diff --git a/docs/examples/alphablending.html b/docs/examples/alphablending.html
index c31a6b957..4eb54f659 100644
--- a/docs/examples/alphablending.html
+++ b/docs/examples/alphablending.html
@@ -78,7 +78,9 @@ func update(screen *ebiten.Image) error {
case 240 < count:
diff = float64(480-count) * 0.2
}
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
screen.Fill(color.NRGBA{0x00, 0x00, 0x80, 0xff})
op := &ebiten.DrawImageOptions{}
op.ColorM.Scale(1.0, 1.0, 1.0, 0.5)
diff --git a/docs/examples/audio.html b/docs/examples/audio.html
index 563318447..1c3b9d478 100644
--- a/docs/examples/audio.html
+++ b/docs/examples/audio.html
@@ -211,7 +211,9 @@ func update(screen *ebiten.Image) error {
}
musicPlayer.updateVolume()
}
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
op := &ebiten.DrawImageOptions{}
x, y, w, h := playerBarRect()
op.GeoM.Translate(float64(x), float64(y))
diff --git a/docs/examples/font.html b/docs/examples/font.html
index 9ce6602ba..5342d4e96 100644
--- a/docs/examples/font.html
+++ b/docs/examples/font.html
@@ -102,6 +102,9 @@ func parseFont() error {
}
func update(screen *ebiten.Image) error {
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
screen.DrawImage(textImage, &ebiten.DrawImageOptions{})
return nil
}
diff --git a/docs/examples/gamepad.html b/docs/examples/gamepad.html
index 9cec700f2..d004ebafe 100644
--- a/docs/examples/gamepad.html
+++ b/docs/examples/gamepad.html
@@ -62,6 +62,9 @@ func update(screen *ebiten.Image) error {
pressedButtons = append(pressedButtons, strconv.Itoa(int(b)))
}
}
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
str := `Gamepad
Axes:
diff --git a/docs/examples/hsv.html b/docs/examples/hsv.html
index 5657e5ea5..ab35a25aa 100644
--- a/docs/examples/hsv.html
+++ b/docs/examples/hsv.html
@@ -83,6 +83,9 @@ func update(screen *ebiten.Image) error {
if ebiten.IsKeyPressed(ebiten.KeyX) {
valueInt++
}
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
hueInt = clamp(hueInt, -256, 256)
saturationInt = clamp(saturationInt, 0, 256)
valueInt = clamp(valueInt, 0, 256)
diff --git a/docs/examples/hue.html b/docs/examples/hue.html
index 9be70d263..435efeef9 100644
--- a/docs/examples/hue.html
+++ b/docs/examples/hue.html
@@ -50,6 +50,9 @@ var (
func update(screen *ebiten.Image) error {
count++
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
w, h := gophersImage.Size()
op := &ebiten.DrawImageOptions{}
op.GeoM.Translate(float64(screenWidth-w)/2, float64(screenHeight-h)/2)
diff --git a/docs/examples/infinitescroll.html b/docs/examples/infinitescroll.html
index 37eda7e65..b1ac9db45 100644
--- a/docs/examples/infinitescroll.html
+++ b/docs/examples/infinitescroll.html
@@ -101,7 +101,9 @@ func drawGroundImage(screen *ebiten.Image, ground *ebiten.Image) {
func update(screen *ebiten.Image) error {
theViewport.Move()
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
updateGroundImage(groundImage)
drawGroundImage(screen, groundImage)
diff --git a/docs/examples/life.html b/docs/examples/life.html
index fc2f9cef6..8d3ce25df 100644
--- a/docs/examples/life.html
+++ b/docs/examples/life.html
@@ -184,6 +184,9 @@ var (
func update(screen *ebiten.Image) error {
world.Progress()
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
world.DrawImage(noiseImage)
screen.ReplacePixels(noiseImage.Pix)
return nil
diff --git a/docs/examples/masking.html b/docs/examples/masking.html
index aad5a7fb5..73d66e4e2 100644
--- a/docs/examples/masking.html
+++ b/docs/examples/masking.html
@@ -77,7 +77,9 @@ func update(screen *ebiten.Image) error {
spotLightY = -spotLightY + 2*maxY
spotLightVY = -spotLightVY
}
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
maskImage.Clear()
op := &ebiten.DrawImageOptions{}
diff --git a/docs/examples/mosaic.html b/docs/examples/mosaic.html
index aa507cc98..910e843a7 100644
--- a/docs/examples/mosaic.html
+++ b/docs/examples/mosaic.html
@@ -50,6 +50,9 @@ var (
)
func update(screen *ebiten.Image) error {
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
op := &ebiten.DrawImageOptions{}
op.GeoM.Scale(1.0/mosaicRatio, 1.0/mosaicRatio)
gophersRenderTarget.DrawImage(gophersImage, op)
diff --git a/docs/examples/noise.html b/docs/examples/noise.html
index 03beac569..d995894b9 100644
--- a/docs/examples/noise.html
+++ b/docs/examples/noise.html
@@ -71,6 +71,9 @@ func update(screen *ebiten.Image) error {
noiseImage.Pix[4*i+2] = uint8(x >> 8)
noiseImage.Pix[4*i+3] = 0xff
}
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
screen.ReplacePixels(noiseImage.Pix)
ebitenutil.DebugPrint(screen, fmt.Sprintf("FPS: %f", ebiten.CurrentFPS()))
return nil
diff --git a/docs/examples/paint.html b/docs/examples/paint.html
index 738bf44b3..80cdd62d7 100644
--- a/docs/examples/paint.html
+++ b/docs/examples/paint.html
@@ -75,7 +75,9 @@ func update(screen *ebiten.Image) error {
if drawn {
count++
}
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
screen.DrawImage(canvasImage, nil)
msg := fmt.Sprintf("(%d, %d)", mx, my)
diff --git a/docs/examples/perspective.html b/docs/examples/perspective.html
index 0164e9e8e..72ae0f82b 100644
--- a/docs/examples/perspective.html
+++ b/docs/examples/perspective.html
@@ -68,6 +68,9 @@ func (p parts) Src(i int) (x0, y0, x1, y1 int) {
}
func update(screen *ebiten.Image) error {
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
op := &ebiten.DrawImageOptions{
ImageParts: &parts{gophersImage},
}
diff --git a/docs/examples/piano.html b/docs/examples/piano.html
index cebf1128b..c5be21dff 100644
--- a/docs/examples/piano.html
+++ b/docs/examples/piano.html
@@ -220,7 +220,9 @@ func update(screen *ebiten.Image) error {
return err
}
}
-
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
screen.Fill(color.RGBA{0x80, 0x80, 0xc0, 0xff})
screen.DrawImage(imagePiano, nil)
diff --git a/docs/examples/rotate.html b/docs/examples/rotate.html
index 575f5437c..3e1faf89e 100644
--- a/docs/examples/rotate.html
+++ b/docs/examples/rotate.html
@@ -50,6 +50,9 @@ var (
func update(screen *ebiten.Image) error {
count++
+ if ebiten.IsRunningSlowly() {
+ return nil
+ }
w, h := gophersImage.Size()
op := &ebiten.DrawImageOptions{}
op.GeoM.Translate(-float64(w)/2, -float64(h)/2)