protected virtual void Initialize(bool pStartPaused) { _intialized = true; _pauseTimer = pStartPaused; AbsoluteTimer = 0.0f; _maxTimeStart = MAX_TIME_DEFAULT; // TimerIcon = Support.TiledSpriteFromFile(TIMER_ICON_PATH, 1, 1); TimerIcon = Support.SpriteFromAtlas("crystallonUI", "timerIcon.png"); TimerIcon.RegisterPalette(0); this.AddChild(TimerIcon); TimeBar = Support.UnicolorSprite( "white", 255, 255, 255, 255); TimeBar.Position = new Vector2(45.0f, 0.0f); TimeBar.RegisterPalette(0); TimerIcon.AddChild(TimeBar); // LeftEnd = Support.TiledSpriteFromFile(TIMER_END_PATH, 1, 1); LeftEnd = Support.SpriteFromAtlas("crystallonUI", "timerEnd.png"); LeftEnd.FlipU = true; // RightEnd = Support.TiledSpriteFromFile(TIMER_END_PATH, 1, 1); RightEnd = Support.SpriteFromAtlas("crystallonUI", "timerEnd.png"); LeftEnd.Color = RightEnd.Color = LevelManager.Instance.BackgroundColor; LeftEnd.Position = TimeBar.Position; RightEnd.Position = new Vector2(TimeBar.Position.X + BASE_SPRITE_WIDTH * TimeBar.Scale.X - BASE_SPRITE_WIDTH, TimeBar.Position.Y); this.AddChild(LeftEnd); this.AddChild(RightEnd); Reset (); UpdateBar(_activeTimeBar); }
// METHODS ------------------------------------------------------------------------------ protected void Initialize() { _initialized = true; Background = Support.SpriteFromFile("/Application/assets/images/LevelTitleBG.png"); Background.Position = new Vector2(0.0f, 0.0f); this.AddChild(Background); this.Height = Background.CalcSizeInPixels().Y; this.Width = Background.CalcSizeInPixels().X; QualityNames = new List<Label>(); map = Crystallography.UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 18, "Regular")); LevelNumberText = new Label(){ Text = "00", FontMap = Crystallography.UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 102, "Bold")), Position = new Vector2( 44.0f, 250.0f), // Color = new Vector4( 0.16078431f, 0.88627451f, 0.88627451f, 1.0f) }; LevelNumberText.RegisterPalette(0); Background.AddChild(LevelNumberText); TapToDismissText = new Label() { Text = "tap to dismiss", FontMap = map, Position = new Vector2( 39.0f, 20.0f) }; TapToDismissText.RegisterPalette(0); Background.AddChild(TapToDismissText); Icons = new SpriteTile[4]; for( int i=0; i < Icons.Length; i++) { Icons[i] = Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2); float y = 176.0f - 88.0f * (float)System.Math.Floor(i/2.0f); Icons[i].Position = new Vector2( 44.0f + 68.0f*(i%2), y); Background.AddChild(Icons[i]); Icons[i].Visible = false; } }