- Edited
just based on the picture I have to create shadows for each character in the screen as a semi 3D shadows. So which is the best way?
just based on the picture I have to create shadows for each character in the screen as a semi 3D shadows. So which is the best way?
To get a "shadow" appearance for a sprite, set its modulate to a black translucent color such as (0, 0, 0, 0.4)
.
To distort it, decrease its Y scale and shear it using a sprite shader. You should be able to find a shader for that online relatively easily.
could you please show few linecode examples?
@Calinou said: To get a "shadow" appearance for a sprite, set its modulate to a black translucent color such as
(0, 0, 0, 0.4)
. To distort it, decrease its Y scale and shear it using a sprite shader. You should be able to find a shader for that online relatively easily.
I need to do that via a script, do you have a short example of that please?
This tool on Itch.IO looks like it has a skewing shader that is controllable via the Godot editor (and likely through script as well): Skew Stretching Godot Engine Editor Tool.
In Godot 4.0, there will be support for skewing Sprites by default.
Seems to be interesting, let me try because I didn't understand how to implement it into the code :)