Initial Commit
Initial commit of Code Base.
This commit is contained in:
parent
293b1213e1
commit
c11a4ebbc2
653 changed files with 36893 additions and 1 deletions
22
Library/Singletons/GifManager.cs
Normal file
22
Library/Singletons/GifManager.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Godot;
|
||||
|
||||
namespace PokePurple.Library.Singletons;
|
||||
|
||||
public class GifManager
|
||||
{
|
||||
private static GifManager? _instance;
|
||||
public static GifManager Instance => _instance ?? (_instance = new GifManager());
|
||||
|
||||
private Node _gifManager;
|
||||
|
||||
public GifManager()
|
||||
{
|
||||
_gifManager = ((SceneTree)Engine.GetMainLoop()).GetRoot().GetNode("GifManager");
|
||||
}
|
||||
|
||||
public AnimatedTexture AnimatedTextureFromBuffer(byte[] data, int max_frames = 0) => _gifManager.Call("animated_texture_from_buffer", data, max_frames).As<AnimatedTexture>();
|
||||
public AnimatedTexture AnimatedTextureFromFile(string file, int max_frames = 0) => _gifManager.Call("animated_texture_from_file", file, max_frames).As<AnimatedTexture>();
|
||||
|
||||
public SpriteFrames SpriteFramesFromBuffer(byte[] data, int max_frames = 0) => _gifManager.Call("sprite_frames_from_buffer", data, max_frames).As<SpriteFrames>();
|
||||
public SpriteFrames SpriteFramesFromFile(string file, int max_frames = 0) => _gifManager.Call("sprite_frames_from_file", file, max_frames).As<SpriteFrames>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue