mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

* This allows to generate interesting visual effects, which can be controlled by events. For example, you can use an outline on an object to highlight, make the player glow when launching a spell, blur objects, etc... * A new "effects" tab is now present in the objects editor. From there, you can add visual effects, that were already available for layers, customize them from this editor. * Actions and conditions are available to manipulate effects and change their parameters during the game. * Learn more on the wiki: http://wiki.compilgames.net/doku.php/gdevelop5/objects/effects Co-authored-by: Florian Rival <Florian.Rival@gmail.com>
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
namespace gdjs {
|
|
gdjs.PixiFiltersTools.registerFilterCreator('Glow', {
|
|
makePIXIFilter: function (target, effectData) {
|
|
const glowFilter = new PIXI.filters.GlowFilter();
|
|
return glowFilter;
|
|
},
|
|
updatePreRender: function (filter, target) {},
|
|
updateDoubleParameter: function (filter, parameterName, value) {
|
|
const glowFilter = (filter as unknown) as PIXI.filters.GlowFilter;
|
|
if (parameterName === 'innerStrength') {
|
|
glowFilter.innerStrength = value;
|
|
} else if (parameterName === 'outerStrength') {
|
|
glowFilter.outerStrength = value;
|
|
} else if (parameterName === 'distance') {
|
|
// @ts-ignore
|
|
glowFilter.distance = value;
|
|
}
|
|
},
|
|
updateStringParameter: function (filter, parameterName, value) {
|
|
const glowFilter = (filter as unknown) as PIXI.filters.GlowFilter;
|
|
if (parameterName === 'color') {
|
|
glowFilter.color = gdjs.PixiFiltersTools.rgbOrHexToHexNumber(value);
|
|
}
|
|
},
|
|
updateBooleanParameter: function (filter, parameterName, value) {},
|
|
});
|
|
}
|