Ejemplo n.º 1
0
        private void WriteTextures(V2DWorld v2dWorld)
        {
            List <string> parsed = new List <string>();

            foreach (string key in usedImages.Keys)
            {
                V2DTexture t = new V2DTexture();
                t.Source = key;// usedImages[key];
                v2dWorld.textures.Add(t);
            }
        }
Ejemplo n.º 2
0
 private void EnsureV2DWorld()
 {
     if (SymbolImport != null && v2dWorld == null)
     {
         // ** note: unnamed elements may actually fall out of scope and get gc/disposed, so need a ref
         // todo: use multiple content loaders per screen and unload where needed.
         //V2DContent content = V2DGame.instance.Content.Load<V2DContent>(SymbolImport.assetName);
         content  = V2DGame.instance.Content.Load <V2DContent>(SymbolImport.assetName);
         v2dWorld = content.v2dWorld;
         textures = content.textures;
         v2dWorld.RootInstance.Definition = v2dWorld.GetDefinitionByName(V2DGame.ROOT_NAME);
     }
 }
Ejemplo n.º 3
0
        private void WriteDefinitions(V2DWorld v2dWorld)
        {
            foreach (Definition2D def in v2d.definitions)
            {
                V2DDefinition d;
                if (def is Text2D)
                {
                    V2DText v2t = new V2DText();
                    d            = v2t;
                    v2t.TextRuns = ((Text2D)def).TextRuns;
                }
                else
                {
                    d = new V2DDefinition();
                    d.V2DShapes.Clear();
                    for (int i = 0; i < def.Shapes.Count; i++)
                    {
                        d.V2DShapes.Add(def.Shapes[i].GetV2DShape());
                    }

                    d.Instances.Clear();
                    if (def.Children.Count > 0)
                    {
                        for (int i = 0; i < def.Children.Count; i++)
                        {
                            d.Instances.Add(GetV2DInstance(def.Children[i]));
                        }
                    }
                }

                v2dWorld.definitions.Add(d);
                d.Name        = def.DefinitionName;
                d.Id          = def.Id;
                d.LinkageName = def.LinkageName;                // paths.ContainsKey(def.Id) ? paths[def.Id] : "";
                d.FrameCount  = def.FrameCount;
                d.OffsetX     = def.Bounds.Point.X;
                d.OffsetY     = def.Bounds.Point.Y;
                d.Width       = def.Bounds.Size.Width;
                d.Height      = def.Bounds.Size.Height;

                d.Joints.Clear();
                if (def.Joints.Count > 0)
                {
                    WriteJointData(d.Joints, def);
                }
            }
        }
Ejemplo n.º 4
0
 public Screen(V2DContent v2dContent)
 {
     this.v2dWorld = v2dContent.v2dWorld;
     this.textures = v2dContent.textures;
     SetAttributes();
 }
Ejemplo n.º 5
0
 public GenV2DWorld(VexTree v2d, Dictionary <string, IDefinition> usedImages)
 {
     this.v2d        = v2d;
     this.usedImages = usedImages;
     v2dWorld        = new V2DWorld();
 }