Beispiel #1
0
        private void HandleElementLoaded(object sender, EventArgs e)
        {
            if (DataHasMember(PersistentDataForCurrentElement, "CellSize"))
            {
                guidesViewModel.CellSize   = (int)PersistentDataForCurrentElement.CellSize;
                guidesViewModel.ShowOrigin = PersistentDataForCurrentElement.ShowOrigin;
                guidesViewModel.ShowGrid   = PersistentDataForCurrentElement.ShowGrid;

                // Can't do a direct assignment because .CameraSave is deserialized as an expando object
                CameraSave cameraSave = new CameraSave();// PersistentDataForCurrentElement.CameraSave;

                cameraSave.AspectRatio      = (float)PersistentDataForCurrentElement.CameraSave.AspectRatio;
                cameraSave.FarClipPlane     = (float)PersistentDataForCurrentElement.CameraSave.FarClipPlane;
                cameraSave.NearClipPlane    = (float)PersistentDataForCurrentElement.CameraSave.NearClipPlane;
                cameraSave.Orthogonal       = PersistentDataForCurrentElement.CameraSave.Orthogonal;
                cameraSave.OrthogonalHeight = (float)PersistentDataForCurrentElement.CameraSave.OrthogonalHeight;
                cameraSave.OrthogonalWidth  = (float)PersistentDataForCurrentElement.CameraSave.OrthogonalWidth;
                cameraSave.X = (float)PersistentDataForCurrentElement.CameraSave.X;
                cameraSave.Y = (float)PersistentDataForCurrentElement.CameraSave.Y;
                cameraSave.Z = (float)PersistentDataForCurrentElement.CameraSave.Z;


                cameraSave.SetCamera(Camera.Main);
            }
            boundsLogic.HandleElementLoaded();
        }
Beispiel #2
0
        public void ApplyToEditor()
        {
            SpriteManager.Camera.Position = EditorCameraPosition;
            CameraBounds.SetCamera(EditorData.SceneCamera);

            EditorData.CurrentPositionedModelMembersWatching.Clear();
            EditorData.CurrentSpriteFrameMembersWatching.Clear();
            EditorData.CurrentSpriteMembersWatching.Clear();
            EditorData.CurrentTextMembersWatching.Clear();

            EditorData.CurrentSpriteMembersWatching.AddRange(CurrentSpriteMembersWatching);
            EditorData.CurrentSpriteFrameMembersWatching.AddRange(CurrentSpriteFrameMembersWatching);
            EditorData.CurrentPositionedModelMembersWatching.AddRange(CurrentPositionedModelMembersWatching);
            EditorData.CurrentTextMembersWatching.AddRange(CurrentTextMembersWatching);
        }
Beispiel #3
0
 public void CustomDestroy()
 {
     FlatRedBallServices.Game.TargetElapsedTime = mOldTimeSpan;
     mOldCameraSetup.SetCamera(SpriteManager.Camera);
     SpriteManager.Camera.BackgroundColor = mOldBackgroundColor;
 }