예제 #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);
        }