(feature request) import SVG as sprite.

Started by FanOfHumor, Mon 04/04/2022 15:53:57

Previous topic - Next topic

FanOfHumor

I don't know anything about how SVG works so I have no idea whether it's plausible or not to import SVG images as sprites into AGS.Ive been learning to make svg recently and I thought"I wonder what it would be like if AGS could import SVG?I'm guessing it would be smooth for even small resolutions.". Would it? Is this possible or just wishful thinking?

Crimson Wizard

There's a difference between importing SVG as bitmaps and using SVG directly. First can be done with some other tool which converts SVG to bmp or png. Second would require writing whole new functionality for AGS engine that would support vector graphics, as right now engine works only with raster (pixel) graphics.

FanOfHumor


eri0o

#3
Tbh, engine wise I thought about making a plugin at some point but all C or C++ libraries I found for SVG were absolutely terrible to work with. Many dependencies, huge codebase, no good way to deal with animation or standard tween of things so you endup with a fancy static bitmap and a big hard to build plugin.

During my experiments though I did found a library that works alrightsh for Lottie format, still it's all rasterized (e.g.: sprites), but this actually enable to make something that would then factory DynamicSprites. I imagine performance could be terrible or not depending on how it would be used by final user of the thing. Problem is Lottie has no decent open source animation tool and also apparently very few people are aware it exists.

In the end I thought that vectors are just too different from how graphics card actually works and I notice most games that employ vector-like graphics use a work pipeline (from the artist perspective) built on 3D concepts, so tools that work with this in mind are more readily available - you can see these tools in many high resolution visual novels.

Example of such tools: https://forums.tigsource.com/index.php?topic=72433.0

FanOfHumor


eri0o

The Lottie library I mentioned: https://github.com/samsung/rlottie

The code itself is MIT licensed, if the person can do with less Lottie features then you can even roll it back for some old versions of it that were a bit lighter on dependencies - but as far as I remember nothing has a too restrictive license.

SMF spam blocked by CleanTalk