.. is a Godot Library for implementing Twitch functionality in Godot. The main purpose is to use this library for easier overlay development. The library can also be used to support Twitch game integration.
TwitchIrcChannel
TwitchEventListener
TwitchCommand
Secondary Features
Most of the features are implemented. Bugs are very likely, cause of the amount of generated code.
Upfront information: You will stumble over a Redirect URL
. This URL has to point to your PC / Application that the authorization is redirected after the login.
In case you have no clue just use http://localhost:7170
and make sure this is the redirect URL in https://dev.twitch.tv
and your settings in Godot at Twitch -> Auth -> redirect_url
/addons/Twitcher
otherwise the internal paths doesn't work anymore.
Tries to make the path relative didn't worked 😒Project -> Project Settings -> Plugins
Project -> Project Settings -> Twitch -> Auth
Insert client credentials, find them at Twitch Dev Console use the guide
Note: for the goblins the secret is invalidated ;)
TwitchService.setup();
at some point in your application when you want to start the Twitch integration. See also the examplesTwitchImageTransformer Is the default transformer for all projects. It doesn't support animation at all and returns static images instead. Version that always should work.
MagickImageTransformer
Cause Godot doesn't support GIF by default the library provides a possibility for exchangeable converter.
Not everyone needs the GIF support. At default the library doesn't use GIF's and requests only static Emojis.
The Converter that is provided by the Lib requires ImageMagick
an external program to convert the GIFs to Images and then gather them to SpriteFrames
.
NativeImageTransformer The native image transformer uses a ported version of vbousquet/godot-gif-importer I can't guarantee that I ported it correctly from Godot 3 to 4 nor I can guarantee that the original Implementation was correctly. This is an alterantive that has to be battle tested. But this one doesn't need any external Program to work (or even not) :D. Also have a look at jegor377/godot-gif-lzw that is used for the LZW compression. The readme has good links for checking this implementation. Couple of parts was broken and I added a "fix".
In case you want to use another way to convert the GIFs. You can easily create a class that has to support:
extends RefCounted
class_name MyImageTransformer
## Should the animated or static version requested
func is_supporting_animation() -> bool:
return true
## path is the location where the GIF file is currently stored
## buffer_in is the data of the GIF that is stored at path location
## output_path is the location where the converted data should be saved (optional)
func convert_image(path: String, buffer_in: PackedByteArray, output_path: String) -> SpriteFrames:
# Implement your custom logic
return SpriteFrames.new();
When you implemented your converter, you can configure the Twitch Lib to use it in the Advanced Settings of the project settings
set Project Settings -> Twitch -> General -> Images -> Image Transformer
to the ClassName it will be load at runtime with load()
function.
To use animated Emojis you need to install ImageMagick and set the path to the executable in
the Advanced Settings of the project settings Project Settings -> Twitch -> General -> Images -> Image Magic
. In case of windows
when you didn't changed the path settings it is enough to write magick
into this field.
For all other users you need a full path to the executable (untested assumption in case of error open issue please).
Also set the Image Transformer
to Magic Image Transformer
afterwards all emojis you receive should be animated.
Uses a modified version of MagicDumps but has the same limitations. Changed the library to use SpriteFrames instead of AnimatedTextures
Inspired by: GIFT
Known Bugs
Nice to Have
Need Support Find me on https://www.twitch.tv/kani_dev/