Beispiel #1
0
        public void AddAnimation(ushort animationId)
        {
            AnimationEntry e = new AnimationEntry();

            AnimationEntries.Add(e);
            AnimationEntriesID.Add(animationId);
        }
Beispiel #2
0
        public void Load(FileStreamEx f)
        {
            m_animcount  = f.ReadUShort();
            m_framecount = f.ReadUShort();

            m_animationframes.Clear();
            m_animationentries.Clear();
            m_animationid.Clear();
            for (int i = 0; i < m_framecount; i++)
            {
                AnimationFrame frame = new AnimationFrame();
                frame.Load(f);
                m_animationframes.Add(frame);
            }
            for (int i = 0; i < m_animcount; i++)
            {
                m_animationid.Add(f.ReadUShort());
            }
            for (int i = 0; i < m_animcount; i++)
            {
                AnimationEntry entry = new AnimationEntry();
                entry.Load(f);
                m_animationentries.Add(entry);
            }
            for (int i = 0; i < m_animcount; i++)
            {
                m_animationentries[i].LoadFrameList(f);
            }
        }
Beispiel #3
0
        private void nAnimationSpeed_ValueChanged(object sender, EventArgs e)
        {
            AnimationEntry entry = animationBox.AnimationEntry;

            if (entry != null)
            {
                entry.Speed = (int)nAnimationSpeed.Value;
            }
        }
Beispiel #4
0
        //////////////////////////////////////////////////////////////////////////
        // Animation
        private void animList1_OnSelectedAnimation(ushort id)
        {
            listFrameBox1.Animation = entity.Animation;
            int index = entity.Animation.GetAnimationIndex(id);

            if (index == -1)
            {
                entity.Animation.AddAnimation(id);
                index = entity.Animation.GetAnimationIndex(id);
            }
            animationBox.SelectedAnimationId = id;
            listFrameBox1.AnimationIndex     = index;

            AnimationEntry entry = animationBox.AnimationEntry;

            if (entry != null)
            {
                nAnimationSpeed.Value = entry.Speed;
            }
        }