示例#1
0
 public void AddToThis(Scene scene)
 {
     mSprites.AddRange(scene.mSprites);
     mSpriteGrids.AddRange(scene.mSpriteGrids);
     mSpriteFrames.AddRange(scene.mSpriteFrames);
     mTexts.AddRange(scene.mTexts);
 }
示例#2
0
        public Scene LoadScene(string fileName, Layer layer)
        {
            Scene scene = null;

            if (
#if XBOX360
                FlatRedBallServices.IgnoreExtensionsWhenLoadingContent == false &&
#endif
                FlatRedBall.IO.FileManager.GetExtension(fileName) == "scnx")
            {
#if XBOX360
                throw new NotImplementedException("Cannot currently load .scnx files on the 360.  Use content manager");
#else
                scene = FlatRedBall.Content.SpriteEditorScene.FromFile(fileName).ToScene(mContentManagerName);
#endif
            }
            else
            {
                // There is either no extension on the fileName or the extensions are being ignored
                // by the engine.
                scene = FlatRedBallServices.Load <Scene>(fileName, mContentManagerName);
            }

            if (scene != null)
            {
                scene.AddToManagers(layer);

                mSprites.AddRange(scene.Sprites);
                mSpriteGrids.AddRange(scene.SpriteGrids);
                mSpriteFrames.AddRange(scene.SpriteFrames);
                mPositionedModels.AddRange(scene.PositionedModels);

                SpriteManager.SortTexturesSecondary();
            }

            mLastLoadedScene = scene;

            return(scene);
        }
示例#3
0
        public PositionedObjectList <Polygon> LoadPolygonList(string name, bool addToShapeManager, bool makeVisible)
        {
            PolygonSaveList psl = PolygonSaveList.FromFile(name);

            PositionedObjectList <Polygon> loadedPolygons = psl.ToPolygonList();

            if (addToShapeManager)
            {
                foreach (Polygon polygon in loadedPolygons)
                {
                    ShapeManager.AddPolygon(polygon);
                }
            }

            foreach (Polygon polygon in loadedPolygons)
            {
                polygon.Visible = makeVisible;
            }

            mPolygons.AddRange(loadedPolygons);

            return(loadedPolygons);
        }