Beispiel #1
0
        /// <summary>
        /// Load spine resources
        /// </summary>
        /// <param name="graphicsDevice"></param>
        public void LoadResources(GraphicsDevice graphicsDevice)
        {
            var textureLoader = new WzSpineTextureLoader(wzSpineAtlasPropertyNode.Parent, graphicsDevice);

            SkeletonData skeletonData = WzSpineAtlasLoader.LoadSkeleton(wzSpineAtlasPropertyNode, textureLoader);

            if (skeletonData == null)
            {
                return;
            }

            bool pma;

            if (wzSpineAtlasPropertyNode.parent is WzImageProperty)
            {
                pma = ((WzImageProperty)wzSpineAtlasPropertyNode.parent)["PMA"].ReadValue(0) > 0;
            }
            else
            {
                pma = ((WzImage)wzSpineAtlasPropertyNode.parent)["PMA"].ReadValue(0) > 0;
            }

            this.SkeletonData       = skeletonData;
            this.PremultipliedAlpha = pma;
        }
        /// <summary>
        /// Load spine resources
        /// </summary>
        /// <param name="graphicsDevice"></param>
        public void LoadResources(GraphicsDevice graphicsDevice)
        {
            var textureLoader = new WzSpineTextureLoader(wzSpineAtlasPropertyNode.Parent, graphicsDevice);

            SkeletonData skeletonData = WzSpineAtlasLoader.LoadSkeleton(wzSpineAtlasPropertyNode, textureLoader);

            if (skeletonData == null)
            {
                return;
            }

            bool pma;

            if (wzSpineAtlasPropertyNode.parent is WzImageProperty imgProperty)
            {
                pma = imgProperty["PMA"].ReadValue(0) > 0;
            }
            else
            {
                pma = ((WzImage)wzSpineAtlasPropertyNode.parent)["PMA"].ReadValue(0) > 0;
            }

            this.SkeletonData       = skeletonData;
            this.PremultipliedAlpha = pma; //  whether the renderer will assume that colors have premultiplied alpha. Default is true.
        }