ID:2918395
 
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
I need a way to export an entire icon as a png sprite sheet, to be used as a cache file. Currently, if you try to send a file that started life as a DMI via browse_rsc(), you just wind up with one frame of the whole sheet. I have already done all the manual legwork for calculating where each frame lands in the final DMI sprite sheet --I just need DS to respect my authority when sending the file.

Basically, I'm just looking for a function that writes the icon to disk, with no ztxt block.

There's also a bit of an issue with fcopy()'s documentation, because it doesn't explicitly tell you that you can write DMI files to disc using this function. An explicit icon.Export() function would shore up both issues nicely by having an explicit function meant to write icon files to disc.

icon.Export(filename,format,[icon_state],[dir],[frame])


format options:
DMI - export as a DMI, zTxt block intact
PNG - export as a PNG, with no zTxt block
JPG - export as a JPG
GIF - export as a GIF (flips through each frame of each direction of each icon_state)

When specifying an icon_state, direction, or frame, this will limit the frames that are output as part of the final exported graphic.


Thankfully, a lot of this behavior is already in DM's DMI editor. I just want some code access to this stuff.