예제 #1
0
        protected override XmlElement VCreateInheritedElement(XmlElement baseElement)
        {
            var textureElement = baseElement.OwnerDocument.CreateElement("Texture");

            textureElement.SetAttribute("resource", Texture);
            baseElement.AppendChild(textureElement);

            var animationElement = baseElement.OwnerDocument.CreateElement("Animation");

            animationElement.SetAttribute("fx", FrameX.ToString(CultureInfo.InvariantCulture));
            animationElement.SetAttribute("fy", FrameY.ToString(CultureInfo.InvariantCulture));
            animationElement.SetAttribute("loop", Looping.ToString(CultureInfo.InvariantCulture));

            if (Speed != null)
            {
                animationElement.SetAttribute("speed", Speed.ToString());
            }

            if (StartFrame != null)
            {
                animationElement.SetAttribute("startFrame", StartFrame.ToString());
            }

            if (EndFrame != null)
            {
                animationElement.SetAttribute("endFrame", EndFrame.ToString());
            }

            if (m_SubAnimations.Count > 0)
            {
                animationElement.SetAttribute("defaultAnim", m_sDefaultAnim);
            }

            foreach (var subAnim in m_SubAnimations.Values)
            {
                var subAnimationNode = baseElement.OwnerDocument.CreateElement("SubAnimation");
                subAnimationNode.SetAttribute("id", subAnim.ID);
                subAnimationNode.SetAttribute("speed", subAnim.Speed.ToString(CultureInfo.InvariantCulture));
                subAnimationNode.SetAttribute("startFrame", subAnim.StartFrame.ToString(CultureInfo.InvariantCulture));
                subAnimationNode.SetAttribute("endFrame", subAnim.EndFrame.ToString(CultureInfo.InvariantCulture));

                animationElement.AppendChild(subAnimationNode);
            }

            baseElement.AppendChild(animationElement);

            var mirroredElement = baseElement.OwnerDocument.CreateElement("Mirrored");

            mirroredElement.SetAttribute("status", Mirrored.ToString(CultureInfo.InvariantCulture));
            baseElement.AppendChild(mirroredElement);

            var scriptElement = baseElement.OwnerDocument.CreateElement("OnEndScript");

            scriptElement.SetAttribute("resource", OnEndScript);
            baseElement.AppendChild(scriptElement);
            return(baseElement);
        }
예제 #2
0
        private void FlipbookSetup_Load(object sender, EventArgs e)
        {
            string[] values = Enum.GetNames(typeof(LoopTypes));
            int      index  = 0;

            foreach (string value in values)
            {
                int temp = flipbookStyle.Items.Add(value);
                if (value == LoopType.ToString())
                {
                    index = temp;
                }
            }
            flipbookStyle.SelectedIndex = index;

            frameSequenceText.Text = FrameSequence;
            endFrame.Text          = Frames.ToString();
            startFrame.Text        = StartFrame.ToString();
            gridXText.Text         = FramesX.ToString();
            gridYText.Text         = FramesY.ToString();
        }
예제 #3
0
 public override string ToString()
 {
     return(StartFrame.ToString() + " " + EndFrame.ToString() + " " + " " + Fichier);
 }
예제 #4
0
 public override string ToString()
 {
     return(FrameCount.ToString() + " " + this.Commentaire + " " + StartFrame.ToString() + " " + EndFrame.ToString() + " " + (EndFrame - StartFrame).ToString());
 }