How would I work with an xml texture atlas?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
GHOSTYMPA
Posts: 26
Joined: Tue Aug 04, 2020 6:38 pm
Contact:

How would I work with an xml texture atlas?

Post by GHOSTYMPA »

I am trying to work out how to make a script that would get a sprite sheet and an xml file containing the coordinates, names, width and height of all sprites within it and create many sub images which are cropped automatically which would save me a lot of time.
I usually have to manually use the crop tool and find sprites myself. How would I go at this?
https://youtube.com/ghostympa
i make youtube videos with animations in them
User avatar
synthsin75
Posts: 10012
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: How would I work with an xml texture atlas?

Post by synthsin75 »

You'd need to use the Lua I/O functions to read the xml and then ImageLayer:SetCroppingBounds(bounds) to crop the image.
Post Reply