Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Godot GIF (4.1)

An asset by b0tlanner
The page banner background of a mountain and forest
Godot GIF (4.1) thumbnail image
Godot GIF (4.1) thumbnail image
Godot GIF (4.1) hero image

Quick Information

0 ratings
Godot GIF (4.1) icon image
b0tlanner
Godot GIF (4.1)

GDExtension for Godot 4.1-4.2 to load GIF files as AnimatedTexture and/or SpriteFrames.

Supported Engine Version
4.1
Version String
1.0.2
License Version
MIT
Support Level
community
Modified Date
28 days ago
Git URL
Issue URL

Godot GIF


Logo

GitHub Build MIT License

Description

GDExtension for Godot 4+ to load GIF files as AnimatedTexture and/or SpriteFrames.

NOTE: AnimatedTexture has been marked as deprecated according to development docs and could be removed in a future version of Godot.

Usage

Editor

Gif files can be imported at edit time as one of the supported types via Import options.

Editor Imports Options

README Editor Imports Options

See the Editor Imports example scene.

Editor Imports Example

README Editor Imports


Runtime

Gif files can be loaded at runtime as one of the supported types via the GifManager singleton.

GifManager exposes the following methods for loading gifs either from file or from bytes directly: README GifManager Methods

e.g. to load from file

get_node("AnimFromRuntimeFile").texture = GifManager.animated_texture_from_file("res://examples/file/optic.gif")

get_node("AnimatedSprite2RuntimeFile").sprite_frames = GifManager.sprite_frames_from_file("res://examples/file/optic.gif")

See the Runtime Imports example scene.

Runtime Imports Example

README Runtime Imports

Installation

Download the gdextension artifact from the latest successful build. (It should be right at the bottom of the Summary) README image

Extract the contents to your Godot project directory.

You should have an addons directory at the root with the following structure:

└───addons
    └───godotgif
        │   godotgif.gdextension
        │   LICENSE.txt
        │   README.md
        │
        └───bin
            │   godotgif.windows.template_debug.x86_32.dll
            │   godotgif.windows.template_debug.x86_64.dll
            │   godotgif.windows.template_release.x86_32.dll
            │   godotgif.windows.template_release.x86_64.dll
            │   libgodotgif.android.template_debug.arm64.so
            │   libgodotgif.android.template_release.arm64.so
            │   libgodotgif.linux.template_debug.x86_32.so
            │   libgodotgif.linux.template_debug.x86_64.so
            │   libgodotgif.linux.template_release.x86_32.so
            │   libgodotgif.linux.template_release.x86_64.so
            │
            ├───godotgif.macos.template_debug.framework
            │       libgodotgif.macos.template_debug
            │
            └───godotgif.macos.template_release.framework
                    libgodotgif.macos.template_release

Open your project. Any exisitng gifs should auto-import. New gifs in the project directory will automatically import as SpriteFrames. To convert them into AnimatedTexture, update the import settings.

The GifManager class should also now be available for access within GDScript.

Contributing

Setup

Ensure SCons is setup. Refer to Introduction to the buildsystem

  • If using a different version of Godot, be sure to dump the bindings e.g.
        godot --dump-extension-api extension_api.json
    
  • Compile with
        scons platform=<platform> custom_api_file=extension_api.json
    

Debugging

This repository is configured for use with VSCode

Launch configurations have been setup for both debugging in editor and in runtime provided certain VSCode extensions are present and environment variables are defined.

The following environment variables are required:

  1. GODOT_PATH - The directory in which Godot is installed
  2. GODOT_EXECUTABLE - The executable name of the Godot installation

More Details

Refer to GDExtension C++ example

License

Unless otherwise specified, the extension is released under the MIT license.

See the full list of third-party libraries with their licenses used by this extension at src/thirdparty/README.md.

This implementation heavily borrowed inspiration from the gif module for Goost that is currently only based on Godot 3

GDExtension for Godot 4.1-4.2 to load GIF files as AnimatedTexture and/or SpriteFrames.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Godot GIF (4.1) icon image
b0tlanner
Godot GIF (4.1)

GDExtension for Godot 4.1-4.2 to load GIF files as AnimatedTexture and/or SpriteFrames.

Supported Engine Version
4.1
Version String
1.0.2
License Version
MIT
Support Level
community
Modified Date
28 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers