This repository contains three custom tools for Godot: KeyDisplay, AnimatedTextureRect, and TextParticleEmitter. These tools provide custom nodes to improve UI work. The repository also includes example scenes to demonstrate how to use each tool.
KeyDisplay
is a Godot tool that provides an easy way to render keys inside the UI. It uses textures from dreammix for the showcase but can be adapted to any texture with code modifications.
- key: The key to be rendered. Options include all keys from dreammix's textures.
- is_pressed: Determines if the key is rendered as pressed.
- keyboard_texture: Texture for regular keys.
- keyboard_extras_texture: Texture for extra keys.
- key_size: Size of each key.
- key_pressed_offset: Number of vertical keys before pressed textures.
- extra_key_pressed_offset: Number of vertical extra keys before pressed textures.
AnimatedTextureRect
provides an easy way to animate with spritesheets inside the UI.
- animation_texture: The animated Texture2D resource.
- h_frames: The number of columns in the sprite sheet.
- v_frames: The number of rows in the sprite sheet.
- frame: Current frame to display from sprite sheet.
h_frames
orv_frames
must be greater than 1.
TextParticleEmitter
is a Godot tool that renders dynamic text as particles using a SubViewport
and GPUParticles2D
. You can customize text, themes, fonts, and particle effects to create engaging visualizations. It's perfect for adding dynamic text effects to your UI.
- text: The text to be rendered.
- theme: The theme for the label rendering the text.
- font_color: The color of the text font.
- font_shadow_color: The color of the text's shadow, if any.
- font_outline_color: The color of the text's outline, if any.
- font: The font used for rendering the text.
- font_size: The size of the font, in pixels.
- size: The size of the viewport used to render the text.
- preset: The particle effect preset, which can be
CUSTOM
,ONEUP
, orEXPLOSION
.
All properties emit the value_change
signal when modified.
The repository includes three example scenes demonstrating the usage of the tools:
key_display_example.tscn
: Showcases theKeyDisplay
tool.animated_texture_rect_example.tscn
: Showcases theAnimatedTextureRect
tool.text_particle_emitter_example.tscn
: Showcases theTextParticleEmitter
tool.
To use these tools in your project, copy the following scripts to your project and add the corresponding nodes to your scenes:
- Add a
KeyDisplay
node to your scene. - Configure the properties in the Inspector to set the key, textures, and other settings.
- Add an
AnimatedTextureRect
node to your scene. - Configure the properties in the Inspector to set the animation texture, frames, and other settings.
- Add an
AnimationPlayer
node to your scene. - Configure your animation to fit your needs.
- Add a
TextParticleEmitter
node to your scene. - Configure the text, theme, font, and colors using the properties.
- Select a particle effect preset (
CUSTOM
,ONEUP
,EXPLOSION
), or manually configure your own particle material.
This project is licensed under the MIT License. See the LICENSE file for details.