Exemplo n.º 1
0
        public static TmxAnimation FromTileId(uint globalTileId)
        {
            TmxAnimation tmxAnimation = new TmxAnimation();
            TmxFrame     item         = TmxFrame.FromTileId(globalTileId);

            tmxAnimation.Frames.Add(item);
            return(tmxAnimation);
        }
Exemplo n.º 2
0
        public static TmxFrame FromTileId(uint tileId)
        {
            TmxFrame tmxFrame = new TmxFrame();
            tmxFrame.GlobalTileId = tileId;
            tmxFrame.DurationMs = 0;

            return tmxFrame;
        }
Exemplo n.º 3
0
        public static TmxFrame FromTileId(uint tileId)
        {
            TmxFrame tmxFrame = new TmxFrame();

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

            return(tmxFrame);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }