Skip to content

Commit 5c50bf8

Browse files
committed
add shader extension
1 parent 3442222 commit 5c50bf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1473
-251
lines changed

.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ function s4j_build() {
2727
alias s4jb="s4j_build"
2828

2929
function s4j_diff_docs() {
30-
nvim -dR <(cd $(s4j_workdir)/docs/de; find . | sort) <(cd $(s4j_workdir)/docs/en; find . | sort)
30+
diff -d <(tree $(s4j_workdir)/docs/en/) <(tree $(s4j_workdir)/docs/de/)
3131
}
3232
alias s4jdd="s4j_diff_docs"
3333

3434
function s4j_lint_docs() {
35-
find docs -type f -print | xargs grep "construction"
35+
find $(s4j_workdir)/docs/en/book -type f -print | xargs grep "construction"
36+
find $(s4j_workdir)/docs/de/book -type f -print | xargs grep "construction"
3637
}
3738
alias s4jld="s4j_lint_docs"
3839

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ index: 4
44
lang: en
55
---
66

7+
## 4.12.0
8+
9+
- 🚀 Feat: There is a new color extension providing a color class and all named HTML colors for easy reference.
10+
11+
```java
12+
Color c = new Color("#FF0000"); // red
13+
mySprite.setTint(c);
14+
15+
mySprite.setTint(HtmlColor.AZURE);
16+
```
17+
18+
- 🚀 Feat: Add shaders to sprites and to stages. You can find the shader example in the examples directory. For a quick overview you can look at the following code snippet, which works for sprites and for stages.
19+
20+
```java
21+
class ShaderSprite extends Sprite {
22+
public ShaderSprite() {
23+
var shader = this.setShader("blur", "blur.glsl");
24+
shader.set("radius", 10.0);
25+
this.switchShader("blur");
26+
}
27+
28+
public void whenKeyPressed(int keyCode) {
29+
if (keyCode == KeyEvent.VK_N) {
30+
this.nextShader();
31+
} else if (keyCode == KeyEvent.VK_R) {
32+
this.resetShader();
33+
}
34+
}
35+
}
36+
```
37+
738
## 4.11.0
839

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

docs/de/book/examples/shader.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Shader
3+
lang: de
4+
---
5+
6+
# Shader
7+
8+
Ein Beispiel, das zeigt, wie man Shader auf Stage- und Sprite-Objekten verwendet.
9+
10+
![Shader Beispiel](/assets/shader.gif)
11+
12+
## Quelltext
13+
14+
- Java: https://github.com/openpatch/scratch-for-java/tree/main/examples/java/Shader
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "addShader"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "getCurrentShader"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "getCurrentShaderIndex"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "getCurrentShaderName"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "getShader"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "nextShader"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"template": "construction",
3+
"class": "Sprite",
4+
"name": "resetShader"
5+
}

0 commit comments

Comments
 (0)