1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-13 01:03:07 +00:00
Pixelorama/src/Classes/LayerEffect.gd

18 lines
326 B
GDScript3
Raw Normal View History

Implement layer effects (#940) * Basic logic for layer effects * Add an FX button and the ability to add effects, no way to remove or change properties of effects yet * Basic and ugly UI for adding and removing effects, no property changing yet * Swap effects * Fix preload shader paths * Change parameters for layer effects * Change gradient parameter in layer effect shaders, and other fixes * Use CollapsibleContainers for the shader properties * Set the correct gradient interpolation mode and color space in the UI * Make effects of group layers apply to children * Change `apply_fx` to `apply_effects`, formatting, some extra doc comments * Apply effects to other canvases, when merging layers and when exporting * Display humanized names of the shader unifrms * Some UI improvements to the LayerEffectsSettings * Add an Enabled button in the layer effects window, and change checkboxes to checkbuttons * Change BaseLayer.apply_effects() to take a cel as a parameter instead * Make layer effect buttons be affected by the modulate icon color * Add option in the View menu whether layer effects are displayed in the canvas or not * Rename `apply_effects()` to `display_effects()` * Add translation strings * Add nearest filter to the gradient map * Don't change Main.tscn * Fix more translations * Change the default cursor shape of the generated UI elements of the layer effects * Add undo/redo and effect application (apply effect destructively) There are some errors due to the usage of anonymous lambda methods in undo/redo, but it seems to be working well regardless. * Make layer effect application work on all cels
2023-11-21 23:06:25 +00:00
class_name LayerEffect
extends RefCounted
var name := ""
var shader: Shader
var params := {}
var enabled := true
func _init(_name: String, _shader: Shader, _params := {}) -> void:
name = _name
shader = _shader
params = _params
func duplicate() -> LayerEffect:
return LayerEffect.new(name, shader, params.duplicate())