Skip to content

Commit 1cc2e97

Browse files
committed
Update graphics effect docs
1 parent 21105d5 commit 1cc2e97

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

docs/Graphics effects.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
\page graphicsEffects Graphics effects
22

3-
libscratchcpp provides API for implementing custom graphics effects.
4-
No effects are currently included with libscratchcpp, but that is planned to change.
3+
libscratchcpp provides API for adding custom graphics effects.
4+
No effects are included with libscratchcpp and must be implemented by the project player.
55

6-
In case you've implemented some of the effects yourself, feel free to make pull requests!
7-
These are the issues (tasks) for the default graphics effects:
8-
9-
- Color: https://github.com/scratchcpp/libscratchcpp/issues/283
10-
- Fisheye: https://github.com/scratchcpp/libscratchcpp/issues/284
11-
- Whirl: https://github.com/scratchcpp/libscratchcpp/issues/285
12-
- Pixelate: https://github.com/scratchcpp/libscratchcpp/issues/286
13-
- Mosaic: https://github.com/scratchcpp/libscratchcpp/issues/287
14-
- Brightness: https://github.com/scratchcpp/libscratchcpp/issues/288
15-
- Ghost: https://github.com/scratchcpp/libscratchcpp/issues/289
16-
17-
# Implementing a graphics effect
18-
To implement a graphics effect that libscratchcpp doesn't support,
6+
# Adding a custom graphics effect
7+
To add a graphics effect that libscratchcpp doesn't support,
198
subclass \link libscratchcpp::IGraphicsEffect IGraphicsEffect \endlink
209
and override all of the methods.
2110

@@ -27,12 +16,14 @@ using namespace libscratchcpp;
2716
The `name()` method should return the name of the effect which is
2817
used by the set and change effect blocks, for example `ghost` or `fisheye`.
2918

30-
The `apply()` method is used to apply the effect on a bitmap. The bitmap
31-
can be accessed using the `bitmap` parameter and is writable.
32-
3319
# Registering the graphics effect
3420
To register the graphics effect, use \link libscratchcpp::ScratchConfiguration::registerGraphicsEffect() ScratchConfiguration::registerGraphicsEffect() \endlink.
3521

3622
```cpp
3723
libscratchcpp::ScratchConfiguration::registerGraphicsEffect(std::make_shared<MyGraphicsEffect>());
3824
```
25+
26+
# Why should effects be registered?
27+
Effects in Scratch are usually identified by their name (`ghost`, `brightness`, etc.), but this isn't effective
28+
when it comes to running projects. Those "names" are therefore replaced by \link libscratchcpp::IGraphicsEffect IGraphicsEffect \endlink
29+
pointers which makes working with effects faster.

0 commit comments

Comments
 (0)