Crates.io | gd-icon-renderer |
lib.rs | gd-icon-renderer |
version | 2.0.0 |
source | src |
created_at | 2023-10-06 23:37:17.567145 |
updated_at | 2023-10-15 08:53:11.274937 |
description | A tool to render Geometry Dash icons. |
homepage | |
repository | https://git.reidlab.online/reidlab/gd-icon-renderer |
max_upload_size | |
id | 995701 |
size | 32,086 |
A rust Geometry Dash icon renderer. Shout out to gd-icon-renderer, this project is just a rewrite but not in libvips
and crystal-lang
for mostly personal use.
Provide your GJ_GameSheet02-uhd
, GJ_GameSheetGlow-uhd
, Robot_AnimDesc2
, and Spider_AnimDesc2
files along with their corresponding *.plist
files. Rendering an icon is as follows:
Import the library:
use gd_icon_renderer;
Load your spritesheets:
// Replace filepaths for whatever you need for your usecase
let game_sheet_02 = gd_icon_renderer::assets::load_spritesheet("assets/GJ_GameSheet02-uhd.plist");
let game_sheet_glow = gd_icon_renderer::assets::load_spritesheet("assets/GJ_GameSheetGlow-uhd.plist");
let robot_sheet = gd_icon_renderer::assets::load_animations("assets/Robot_AnimDesc2.plist");
let spider_sheet = gd_icon_renderer::assets::load_animations("assets/Spider_AnimDesc2.plist");
Render the icon out:
let icon_img = gd_icon_renderer::renderer::render_icon("ship", 44, [0.0, 0.0, 0.0], [255.0/255.0, 125.0/255.0, 125.0/255.0], true, game_sheet_02, game_sheet_glow, robot_sheet, spider_sheet).expect("failed to render image");
You'll now be given a DynamicImage
You'll most likely want to save the resulting image somewhere:
icon_img.save("icon_rendered.png").unwrap();
spider_16
for some reason?? Related issue on the inspired project here.