예제 #1
0
    public virtual PrismLayerNode GetPrismNode(PrismLayerNode parent, Dictionary <TextureSet.Tile, PrismTexture.Tile> tiles)
    {
        PrismLayerNode node = new PrismLayerNode(name, parent);

        foreach (LayerNode n in Nodes)
        {
            n.GetPrismNode(node, tiles);
        }

        return(node);
    }
예제 #2
0
 public LayerNode(PrismLayerNode copy, Dictionary <PrismTexture.Tile, TextureSet.Tile> tiles, Editor e)
     : this(copy.Name, e)
 {
     foreach (PrismLayerNode n in copy.Nodes)
     {
         if (n is PrismLayer)
         {
             Nodes.Add(new Layer(n as PrismLayer, tiles, e));
         }
         else
         {
             Nodes.Add(new LayerNode(n, tiles, e));
         }
     }
 }
예제 #3
0
    public override PrismLayerNode GetPrismNode(PrismLayerNode parent, Dictionary <TextureSet.Tile, PrismTexture.Tile> tiles)
    {
        PrismLayer node = new PrismLayer(Name, parent);

        foreach (EMesh m in Meshes)
        {
            Vector2[]  pos = new Vector2[m.Vertices.Count];
            ColorHSL[] col = new ColorHSL[m.Vertices.Count];

            for (int i = 0; i < pos.Length; i++)
            {
                pos[i] = m.Vertices[i].Position;
                col[i] = m.Vertices[i].HSL;
            }

            PrismMesh mesh = new PrismMesh(pos, col, m.Tile != null ? tiles[m.Tile] : null);
            node.Meshes.Add(mesh);
        }

        return(node);
    }