Esempio n. 1
0
 /*
  *      Constructor
  */
 public PixelSourceLayer(LayeredTexture parent, PixelSource ps, Pixel.PixelBlendMode blendMode, int xOffset, int yOffset)
 {
     mPixelSource    = ps;
     mPixelBlendMode = blendMode;
     mOffsetX        = xOffset;
     mOffsetY        = yOffset;
     mParent         = parent;
     mFilter         = new ClearFilter();
 }
Esempio n. 2
0
        /// <summary>
        /// Set the PixelSource of a layer. Get the Source from the AssetRepository
        /// </summary>
        public void SetLayerSource(AssetSubType type, PixelSource source)
        {
            if (!mTypeToLayer.ContainsKey(type))
            {
                throw new Exception("AvatarTexture does not have layer for asset type " + type);
            }

            mTexturePalette.SetLayerPixelSource(mTypeToLayer[type], source);
        }
Esempio n. 3
0
        public void AddLayer(string name, Pixel.PixelBlendMode blendMode, PixelSource newPixelSource, int xOffset, int yOffset)
        {
            // Check if a layer with the same name already exists
            if (HasLayer(name))
            {
                Console.LogError("LayeredTexture AddLayer: PixelSource with name " + name + " already exists.");
            }

            // Add layer
            AddLayer(name, new PixelSourceLayer(this, newPixelSource, blendMode, xOffset, yOffset));
        }
Esempio n. 4
0
        public void CreateLayerInAllZones(string layerName, PixelSource newPixelSource, Pixel.PixelBlendMode blendMode)
        {
            PixelSourceLayer newLayer = new PixelSourceLayer(this, newPixelSource, blendMode, 0, 0);

            mUniversalLayers.Add(newLayer);

            // Add this layer to all zones
            for (int x = 0; x < mZones.Count; ++x)
            {
                mZones[x].AddLayer(newLayer);
            }

            // Create Layer
            AddLayer(layerName, newLayer);
        }
Esempio n. 5
0
        public void SetLayerPixelSource(string layerName, PixelSource newPixelSource)
        {
            // Check if a layer exists
            if (HasLayer(layerName))
            {
                // Get relevant layer
                PixelSourceLayer layer = GetLayer(layerName);

                // Mark the old pixel source as dirty
                MarkAsDirty(layer);

                // Swap
                layer.PixelSource = newPixelSource;

                // Mark the new source as dirty
                MarkAsDirty(layer);
            }
            else
            {
                Console.LogError("LayeredTexture SetLayerPixelSource: Layer with name " + layerName + " does not exist");
            }
        }
Esempio n. 6
0
 public void AddLayer(string name, Pixel.PixelBlendMode blendMode, PixelSource newPixelSource)
 {
     AddLayer(name, blendMode, newPixelSource, 0, 0);
 }
Esempio n. 7
0
 public TextureAsset(AssetSubType type, PixelSource tex, string displayName, string path, string key)
     : base(type, displayName, path, key)
 {
     mPixelSource = tex;
 }