loodakrawa / SpriterDotNet

A pure C# Spriter implementation
zlib License
220 stars 75 forks source link

File.Width and Height not used #37

Closed wighawag closed 8 years ago

wighawag commented 8 years ago

I can see that File.PivotX and PivotY are used in case the SpriterObject do not have the pivotX and pivotY set (right?) but I can see no use of FIle.width and Height.

Is it a bug?

If not , why is there such field ?

loodakrawa commented 8 years ago

Those files are there because the scml file has those properties in the file entry. Although it is not used, I did a verbatim mapping between the data structure used in SpriterDotNet and the scml file because that might be needed for some frameworks. For example, it might me used in the renderer:

https://github.com/loodakrawa/SpriterDotNet/blob/develop/SpriterDotNet.MonoGame/MonogameSpriterAnimator.cs#L42

In this instance, the Monogame's Texture2D has Width and Height but these values could also easily come from the File entry.