Пример #1
0
        public static TmxAnimation FromTileId(uint globalTileId)
        {
            TmxAnimation tmxAnimation = new TmxAnimation();
            TmxFrame     item         = TmxFrame.FromTileId(globalTileId);

            tmxAnimation.Frames.Add(item);
            return(tmxAnimation);
        }
Пример #2
0
        public static TmxFrame FromTileId(uint tileId)
        {
            TmxFrame tmxFrame = new TmxFrame();
            tmxFrame.GlobalTileId = tileId;
            tmxFrame.DurationMs = 0;

            return tmxFrame;
        }
Пример #3
0
        public static TmxFrame FromTileId(uint tileId)
        {
            TmxFrame tmxFrame = new TmxFrame();

            tmxFrame.GlobalTileId = tileId;
            tmxFrame.DurationMs   = 0;

            return(tmxFrame);
        }
Пример #4
0
        // Returns an single frame animation
        public static TmxAnimation FromTileId(uint globalTileId)
        {
            TmxAnimation tmxAnimation = new TmxAnimation();

            TmxFrame tmxFrame = TmxFrame.FromTileId(globalTileId);
            tmxAnimation.Frames.Add(tmxFrame);

            return tmxAnimation;
        }
Пример #5
0
        public static TmxFrame FromXml(XElement xml, uint globalStartId)
        {
            TmxFrame tmxFrame        = new TmxFrame();
            uint     attributeAsUInt = TmxHelper.GetAttributeAsUInt(xml, "tileid");

            tmxFrame.GlobalTileId = attributeAsUInt + globalStartId;
            tmxFrame.DurationMs   = TmxHelper.GetAttributeAsInt(xml, "duration", 100);
            return(tmxFrame);
        }
Пример #6
0
        public static TmxFrame FromXml(XElement xml, uint globalStartId)
        {
            TmxFrame tmxFrame = new TmxFrame();

            uint localTileId = TmxHelper.GetAttributeAsUInt(xml, "tileid");
            tmxFrame.GlobalTileId = localTileId + globalStartId;
            tmxFrame.DurationMs = TmxHelper.GetAttributeAsInt(xml, "duration", 100);

            return tmxFrame;
        }
Пример #7
0
        public static TmxAnimation FromXml(XElement xml, uint globalStartId)
        {
            TmxAnimation tmxAnimation = new TmxAnimation();

            foreach (XElement item in xml.Elements("frame"))
            {
                TmxFrame tmxFrame = TmxFrame.FromXml(item, globalStartId);
                tmxAnimation.Frames.Add(tmxFrame);
                tmxAnimation.TotalTimeMs += tmxFrame.DurationMs;
            }
            return(tmxAnimation);
        }
Пример #8
0
        public static TmxAnimation FromXml(XElement xml, uint globalStartId)
        {
            TmxAnimation tmxAnimation = new TmxAnimation();

            foreach (var xmlFrame in xml.Elements("frame"))
            {
                TmxFrame tmxFrame = TmxFrame.FromXml(xmlFrame, globalStartId);
                tmxAnimation.Frames.Add(tmxFrame);
            }

            return(tmxAnimation);
        }