Skip to content

Commit 66b7e65

Browse files
committed
The blend mode can be set by a string now as well as a number (sprite.blendMode = 'ADD').
1 parent fa620e8 commit 66b7e65

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

v3/src/gameobjects/components/BlendMode.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ var BlendMode = {
1515

1616
set: function (value)
1717
{
18+
if (typeof value === 'string')
19+
{
20+
value = BlendModes[value];
21+
}
22+
1823
value | 0;
1924

2025
if (value >= 0)
@@ -25,6 +30,7 @@ var BlendMode = {
2530

2631
},
2732

33+
// const or string
2834
setBlendMode: function (value)
2935
{
3036
this.blendMode = value;

0 commit comments

Comments
 (0)