示例#1
0
        public override void Draw(IDrawDevice device)
        {
            /*
             * Color32 color = new Color32 (0x00, 0xff, 0xff, 0xff);
             * device.FillEllipse (color, headBone.Native);
             * device.DrawLine (color, neckBone.position, headBone.position);
             * device.DrawLine (color, root.position, bodyBone.position);
             * device.DrawLine (color, bodyBone.position, neckBone.position);
             * device.DrawLine (color, legLBone.position, legLBone.right + legLBone.position);
             * device.DrawLine (color, legRBone.position, legRBone.right + legRBone.position);
             * device.DrawLine (color, handLBone.position, handLBone.right + handLBone.position);
             * device.DrawLine (color, handRBone.position, handRBone.right + handRBone.position);
             * device.DrawLine (color, kneeLBone.position, kneeLBone.right + kneeLBone.position);
             * device.DrawLine (color, kneeRBone.position, kneeRBone.right + kneeRBone.position);
             * device.DrawLine (color, elbowLBone.position, elbowLBone.right + elbowLBone.position);
             * device.DrawLine (color, elbowRBone.position, elbowRBone.right + elbowRBone.position);
             */

            device.DrawImage(headTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0f, 0f), new Vector2(2f, 1f / 0.6f), 0f) * headBone.Native);

            device.DrawImage(bodyTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0f, 0.5f), new Vector2(1f, 1f), 0f) * bodyBone.Native);

            device.DrawImage(armTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.4f, 0f), new Vector2(1.2f, 1.2f), 90f) * handLBone.Native);
            device.DrawImage(armTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.4f, 0f), new Vector2(1.2f, 1.2f), 90f) * handRBone.Native);

            device.DrawImage(handTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.3f, 0f), new Vector2(1.3f, 1.3f), 90f) * elbowLBone.Native);
            device.DrawImage(handTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.3f, 0f), new Vector2(1.3f, 1.3f), 90f) * elbowRBone.Native);

            device.DrawImage(legTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.5f, 0f), new Vector2(1f, 1f), 90f) * legLBone.Native);
            device.DrawImage(legTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.5f, 0f), new Vector2(1f, 1f), 90f) * legRBone.Native);

            device.DrawImage(kneeTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.5f, 0f), new Vector2(1f, 1f), 90f) * kneeLBone.Native);
            device.DrawImage(kneeTexture, Matrix3x3.CreateTransformMatrix(new Vector2(0.5f, 0f), new Vector2(1f, 1f), 90f) * kneeRBone.Native);
        }