Skip to content

Commit 2425e31

Browse files
committed
fix missing stamp method on sprite
1 parent e4dede7 commit 2425e31

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ classes
1212
docs/en/public/reference
1313
docs/en/book/changelog.md
1414

15+
natives
1516

1617
# Ignore Gradle project-specific cache directory
1718
.gradle

.project

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>main</name>
4+
<comment/>
5+
<projects/>
6+
<buildSpec>
7+
<buildCommand>
8+
<name>org.eclipse.jdt.core.javabuilder</name>
9+
<arguments/>
10+
</buildCommand>
11+
</buildSpec>
12+
<natures>
13+
<nature>org.eclipse.jdt.core.javanature</nature>
14+
</natures>
15+
</projectDescription>

examples/reference/SpriteStamp.gif

475 KB
Loading

src/org/openpatch/scratch/Sprite.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,10 @@ public void broadcast(String message) {
11801180

11811181
public void whenIReceive(String message) {}
11821182

1183+
public void stamp() {
1184+
this.stampToBackground();
1185+
}
1186+
11831187
public void stampToBackground() {
11841188
if (this.costumes.size() > 0) {
11851189
var stamp =

src/org/openpatch/scratch/internal/Applet.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class Applet extends PApplet {
3030
public CopyOnWriteArrayList<StageBox> stages = new CopyOnWriteArrayList<>();
3131
public int currentStage = -1;
3232

33+
private boolean hasLoaded = false;
3334
private String loadingText = "";
3435

3536
private class StageBox {
@@ -221,6 +222,7 @@ public void loadAssets() {
221222
} catch (IOException | URISyntaxException e) {
222223
}
223224
}
225+
this.hasLoaded = true;
224226
}
225227

226228
private float loadingStatus() {
@@ -256,7 +258,7 @@ public void keyEvent(KeyEvent e) {
256258

257259
public void draw() {
258260
int sizeStages = this.stages.size();
259-
if (this.loadingStatus() < 1) {
261+
if (!this.hasLoaded || this.loadingStatus() < 1) {
260262
this.background(0x222222);
261263
this.image(this.loading, this.width / 2, this.height / 2);
262264
this.textAlign(CENTER);

0 commit comments

Comments
 (0)