Exemple #1
0
        public void RegisterStage(Stage stage)
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format("Registering stage [{0}] at depth {1}", stage, stage.ZIndex));
            }
#endif
            if (_stageListDesc.Contains(stage))
            {
                Debug.LogWarning(string.Format("Multiple registration of the same Stage [{0}]", stage));
                return;
            }

            if (_stageListDesc.Exists(delegate(Stage s) { return(s.ZIndex == stage.ZIndex); }))
            {
                Debug.LogWarning(string.Format("Note: Duplicated stage Z-index: {0} [{1}]", stage.ZIndex, stage));
            }

            // add it to the collection (it has to be done prior to running the StyleInitializer, because the initializer uses this list
            _stageListDesc.Add(stage);

            // resize to screen size

            /*stage.Width = _size.X;
             * stage.Height = _size.Y;*/

            stage.SetActualSize(_size.X, _size.Y);

            // NOTE: without the explicit sizing, loading mask doesn't center itself (?) (20131217)
            // (also should be done on screen resize)
            stage.Width  = _size.X;
            stage.Height = _size.Y;

            StyleInitializer.Run();
            InitStageStyles(stage);

            // initialize (create children etc.)
            stage.Initialize();

            // sort stage list by depth on each addition
            Sort();
        }
Exemple #2
0
 /// <summary>
 /// Called from the editor when we want the total reprocessing of styles
 /// </summary>
 public static void ProcessStyles()
 {
     //Debug.Log("ProcessStyles");
     StyleCacheDirty = true;
     StyleInitializer.Run();
 }