Beispiel #1
0
        private void AddLayer(int bodyID, int hue, bool asMount = false)
        {
            int   facing    = MirrorFacingForDraw(Facing);
            int   animation = 0;
            float frame     = 0;

            if (Entity is Mobile)
            {
                animation = (Entity as Mobile).Animation.ActionIndex;
                if (asMount)
                {
                    animation = patchMountAction(animation);
                }
                frame = (Entity as Mobile).Animation.AnimationFrame;
            }
            else if (Entity is Corpse)
            {
                animation = ActionTranslator.GetActionIndex(Entity, MobileAction.Death);
                frame     = (Entity as Corpse).Frame * BodyConverter.DeathAnimationFrameCount(Body);
            }

            int             frameCount;
            IAnimationFrame animframe = getFrame(bodyID, ref hue, facing, animation, frame, out frameCount);

            m_MobileLayers[m_LayerCount++] = new MobileViewLayer(bodyID, hue, animframe);
            m_FrameCount = frameCount;
        }
Beispiel #2
0
        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            int facing     = MirrorFacingForDraw(Entity.Facing);
            int frameIndex = (int)(Entity.Frame * BodyConverter.DeathAnimationFrameCount(Entity.Body));

            IAnimationFrame animationFrame = getFrame(Entity.Body, facing, frameIndex, Entity.Hue);

            DrawTexture = animationFrame.Texture;
            DrawArea    = new Rectangle(0, 0, DrawTexture.Width, DrawTexture.Height);
            DrawFlip    = false;

            return(base.Draw(spriteBatch, drawPosition, mouseOverList, map));
        }
Beispiel #3
0
        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            int facing     = MirrorFacingForDraw(Entity.Facing);
            int frameIndex = (int)(Entity.Frame * BodyConverter.DeathAnimationFrameCount(Entity.Body));

            IAnimationFrame animationFrame = getFrame(Entity.Body, facing, frameIndex, Entity.Hue);

            DrawFlip = (MirrorFacingForDraw(Entity.Facing) > 4) ? true : false;

            DrawTexture = animationFrame.Texture;

            DrawArea = new Rectangle(
                animationFrame.Center.X - IsometricRenderer.TILE_SIZE_INTEGER_HALF,
                DrawTexture.Height - IsometricRenderer.TILE_SIZE_INTEGER_HALF + (Entity.Z * 4) + animationFrame.Center.Y, DrawTexture.Width, DrawTexture.Height);
            // DrawArea = new Rectangle(0, 0, DrawTexture.Width, DrawTexture.Height);

            return(base.Draw(spriteBatch, drawPosition, mouseOverList, map));
        }