Skip to content

Commit 3c3a5f2

Browse files
committed
add texture sampling mode
1 parent 76c1539 commit 3c3a5f2

File tree

12 files changed

+645
-406
lines changed

12 files changed

+645
-406
lines changed

Diff for: docs/de/book/changelog.md

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ index: 4
44
lang: en
55
---
66

7+
## 4.12.0
8+
9+
- 🚀 Feat: You can set the texture sampling mode. For pixel art games, you can set the texture sampling mode to nearest neighbor. This will prevent the textures from being interpolated.
10+
11+
```java
12+
public class MyStage() {
13+
public MyStage() {
14+
super(800, 400);
15+
setTextureSampling(2); // set the texture sampling to point sampling.
16+
}
17+
}
18+
```
19+
720
## 4.11.0
821

922
- 🚀 Feat: A broadcast and whenIReceive methods for the Object-class, which makes it possible to send anything as a broadcast.

Diff for: examples/java/Robot/Robot.java

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
public class Robot extends Stage {
66
public Robot() {
77
super(800, 600);
8+
this.setDebug(true);
89
this.add(new RobotSprite());
910
}
1011

Diff for: examples/java/Tiled/Fireball.java

+4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ public void run() {
2121

2222
if (dir == "left") {
2323
this.changeX(-speed);
24+
this.setDirection(0);
2425
} else if (dir == "right") {
2526
this.changeX(speed);
27+
this.setDirection(180);
2628
} else if (dir == "up") {
29+
this.setDirection(90);
2730
this.changeY(speed);
2831
} else if (dir == "down") {
32+
this.setDirection(270);
2933
this.changeY(-speed);
3034
}
3135

Diff for: examples/java/Tiled/World.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public World() {
1414
GameState.load();
1515
I18n.select(GameState.get().locale);
1616
this.loadMap(GameState.get().map);
17+
this.setTextureSampling(2);
1718
}
1819

1920
public void whenKeyPressed(int keyCode) {
@@ -62,11 +63,10 @@ public void loadMap(String mapFile) {
6263
}
6364
} else if ("enemy".equals(object.type)) {
6465
switch (object.name) {
65-
case "bamboo":
66-
{
67-
this.add(new Bamboo(object.x, object.y));
68-
break;
69-
}
66+
case "bamboo": {
67+
this.add(new Bamboo(object.x, object.y));
68+
break;
69+
}
7070
}
7171
}
7272
}

Diff for: examples/reference/SpriteIfOnEdgeBounce.gif

154 KB
Loading

Diff for: resources/build.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ author.url=https://openpatch.org
4040
# This is NOT a direct link to where to download it.
4141

4242
library.url=https://github.com/openpatch/scratch-for-java
43-
library.version=4.16.0
43+
library.version=4.17.0
4444

4545

4646
# Set the category (or categories) of your Library from the following list:
@@ -80,5 +80,5 @@ library.keywords=scratch
8080
# Include javadoc references into your project's javadocs.
8181

8282
#javadoc.java.href=http://docs.oracle.com/javase/7/docs/api/
83-
javadoc.java.href=http://docs.oracle.com/en/java/javase/17/docs/api/
83+
javadoc.java.href=http://docs.oracle.com/en/java/javase/21/docs/api/
8484
javadoc.processing.href=http://processing.github.io/processing-javadocs/core/

0 commit comments

Comments
 (0)