defold / defold/defold

Allow for sprite's Blend Mode to be updated programmatically

Open
#9,292 3 comments 6 reactions 0 assignees View on GitHub
engine feature request sprite
Dominant language
C++
Stars
6.3k
Forks
455
Avg merge
2d 2h
Merged PRs (30d)
129

Description

**Is your feature request related to a problem?**
I would like to change the Blend Mode of sprites programmatically.

Context: We have a lot of decals in our game, that we place using our custom level loader and I now have a "Decal" type, a "Screen Decal" type and a "Multiply Decal" type. Instead of a decal type with a Blend Mode property.

I can also imagine sprites changing Blend Mode based on game logics (e.g. Ghosts in Pacman changing appearance).

**Describe the solution you'd like:**
I would like to be able to change the Blend Mode of an instance of the sprite component of a game object:

```lua
msg.post(sprite_url, "blend_mode", sprite.BLEND_MULTIPLY)
```
or:
```lua
sprite.set_blend_mode(sprite_url, sprite.BLEND_SCREEN) -- like gui.set_blend_mode
```

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.