public HighScoreEntry() { var map = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 102, "Bold") ); _bestCubes = _bestPoints = 0; _bestCubesTitle = new Label() { FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), Text = "the most cubes", Position = new Vector2(0.0f, 279.0f) }; _bestCubesTitle.RegisterPalette(0); this.AddChild(_bestCubesTitle); _cubeIcon = Support.SpriteFromFile("/Application/assets/images/UI/cubes_big.png"); _cubeIcon.Position = new Vector2(0.0f, 194.0f); _cubeIcon.RegisterPalette(0); this.AddChild(_cubeIcon); _bestCubesText = new Label() { Text = _bestCubes.ToString(), FontMap = map, Position = new Vector2(97.0f, 174.0f) }; _bestCubesText.RegisterPalette(0); this.AddChild(_bestCubesText); _bestPointsTitle = new Label() { FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), Text = "the most points", Position = new Vector2(0.0f, 108.0f) }; _bestPointsTitle.RegisterPalette(1); this.AddChild(_bestPointsTitle); _scoreIcon = Support.SpriteFromFile("/Application/assets/images/UI/points_big.png"); _scoreIcon.Position = new Vector2(0.0f, 20.0f); _scoreIcon.RegisterPalette(1); this.AddChild(_scoreIcon); _bestPointsText = new Label() { Text = _bestPoints.ToString(), FontMap = map, Position = new Vector2(97.0f, 0.0f) }; _bestPointsText.RegisterPalette(1); this.AddChild(_bestPointsText); }
private void Initialize() { FontMap map = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") ); FontMap bigMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 44, "Bold") ); // CREATE PAUSE MENU pausePanel = new PausePanel(_scene); _scene.DialogLayer.AddChild(pausePanel); pausePanel.Hide(); // CREATE THE HUD BAR AT THE TOP OF THE SCREEN GameHudBar = new Node(){ Position = new Vector2(0.0f, 473.0f) }; this.AddChild(GameHudBar); HudBarMask = Support.UnicolorSprite("white", 255, 255, 255, 255); HudBarMask.Color = LevelManager.Instance.BackgroundColor; HudBarMask.Scale = new Vector2(60.0f, 4.4375f); GameHudBar.AddChild(HudBarMask); // CREATE THE LEVEL TITLE HUD levelTitle = new LevelTitleMkTwo() { SlideInDirection = SlideDirection.RIGHT, SlideOutDirection = SlideDirection.LEFT, Offset = new Vector2(0.0f, 0.0f), // Lifetime = 4.0f }; this.AddChild(levelTitle, -1); // CREATE THE END-OF-LEVEL DROP-DOWN PANEL if (GameScene.currentLevel == 999) { // INFINITE MODE VERSION _nextLevelPanel = new InfiniteModeEndPanel(){ Offset = new Vector2(Director.Instance.GL.Context.Screen.Width-248.0f, 0.0f), }; } else { // PUZZLE/TUTORIAL MODE VERSION _nextLevelPanel = new NextLevelPanel(){ Offset = new Vector2(510.0f, 0.0f), }; } GameHudBar.AddChild(_nextLevelPanel, -1); // CREATE MESSAGE PANEL _messagePanel = new MessagePanel(920.0f, 148.0f ){ SourceObject = this, Offset = new Vector2(20.0f, 0.0f), Position = new Vector2(0.0f, -148.0f), Lifetime = 0.0f }; this.AddChild(_messagePanel); _messagePanel.body = GamePhysics.Instance.RegisterPhysicsBody(GamePhysics.Instance.SceneShapes[4], float.MaxValue, 0.0f, _messagePanel.Position / GamePhysics.PtoM); _messagePanel.AdHocDraw += () => { _messagePanel.body.Position = _messagePanel.Position / GamePhysics.PtoM; }; // SCORE STUFF // ScoreIcon = Support.SpriteFromFile("/Application/assets/images/handIcon.png"); ScoreIcon = Support.SpriteFromAtlas("crystallonUI", "handIcon.png"); ScoreIcon.Position = new Vector2(184.0f, 16.0f); ScoreIcon.RegisterPalette(1); GameHudBar.AddChild(ScoreIcon); ScoreTitleText = new Label("score", map); ScoreTitleText.Position = new Vector2(287, 25.0f); ScoreTitleText.RegisterPalette(1); BlueBox = Support.UnicolorSprite("white", 255,255,255,255); BlueBox.Scale = new Vector2(6.25f, 4.4375f); BlueBox.Position = new Vector2(354.0f, 0.0f); BlueBox.RegisterPalette(2); ScoreText = new Label("", bigMap) { Position = SCORE_TEXT_POS }; ScoreText.RegisterPalette(1); GameHudBar.AddChild(ScoreText); // CUBE STUFF // CubeIcon = Support.SpriteFromFile("/Application/assets/images/stopIcon.png"); CubeIcon = Support.SpriteFromAtlas("crystallonUI", "stopIcon.png"); CubeIcon.Position = new Vector2(20.0f,16.0f); CubeIcon.RegisterPalette(2); GameHudBar.AddChild(CubeIcon); CubesTitleText = new Label("cubes", map); CubesTitleText.Position = new Vector2(63.0f, 25.0f); CubesTitleText.RegisterPalette(2); RedBox = Support.UnicolorSprite("white", 255,255,255,255); RedBox.Position = new Vector2(130.0f, 0.0f); RedBox.Scale = new Vector2(6.25f, 4.4375f); RedBox.RegisterPalette(1); CubeText = new Label("", bigMap){ Position = CUBES_TEXT_POS }; CubeText.RegisterPalette(2); GameHudBar.AddChild(CubeText); // TIMER & STRIKES STUFF GameTimer = new TimerEntity(); if (GameScene.currentLevel == 999) { // ------------------- IF CHALLENGE MODE if(GameScene.gameTimeLimit > 0.0f) { GameTimer.Position = new Vector2(348.0f, 16.0f); // ----- ADD THE TIME BAR GameHudBar.AddChild(GameTimer); } else { BonusBar = new BonusTimer() { // Position = new Vector2(348.0f, 44.0f) Position = new Vector2(348.0f, 16.0f) }; GameHudBar.AddChild(BonusBar); } Strikes = new StrikeHud() { Position = new Vector2(395.0f, 44.0f) }; GameHudBar.AddChild(Strikes); } // PAUSE BUTTON PauseButton = new BetterButton("/Application/assets/images/UI/BetterButtonTransparent.png", 115.0f, 71.0f) { Text = "", // Icon = Support.SpriteFromFile("Application/assets/images/UI/pause.png"), Icon = Support.SpriteFromAtlas("crystallonUI", "pause.png"), // Position = new Vector2(845.0f, 473.0f), Position = new Vector2(845.0f, 0.0f) }; // this.AddChild(PauseButton); GameHudBar.AddChild(PauseButton); PauseButton.background.RegisterPalette(2); PauseButton.background.Scale = new Vector2(115.0f/32.0f, 71.0f/16.0f); PauseButton.Icon.RegisterPalette(2); PauseButton.ButtonUpAction += HandlePauseButtonButtonUpAction; // HIT ME BUTTON HitMeButton = new BetterButton("/Application/assets/images/UI/BetterButtonTransparent.png", 115.0f, 71.0f) { Text = "", // Icon = Support.SpriteFromFile("Application/assets/images/UI/plus.png"), Icon = Support.SpriteFromAtlas("crystallonUI", "plus.png"), // Position = new Vector2(720.0f, 473.0f), Position = new Vector2(720.0f, 0.0f) }; HitMeButton.On(!LevelManager.Instance.HitMeDisabled); // this.AddChild(HitMeButton); GameHudBar.AddChild(HitMeButton); HitMeButton.background.RegisterPalette(1); HitMeButton.background.Scale = new Vector2(115.0f/32.0f, 71.0f/16.0f); HitMeButton.Icon.RegisterPalette(1); HitMeButton.ButtonUpAction += HandleHitMeButtonButtonUpAction; HudBarLine = Support.UnicolorSprite("white", 255, 255, 255, 255); HudBarLine.RegisterPalette(0); HudBarLine.Scale = new Vector2(60.0f, 0.125f); GameHudBar.AddChild(HudBarLine); _initialized = true; }
protected void Initialize(float pWidth, float pHeight) { DismissDelay = 0.0f; // dismiss only with ok button! Height = pHeight; Width = pWidth; var xScale = pWidth/16.0f; var yScale = pHeight/16.0f; SlideInDirection = SlideDirection.RIGHT; SlideOutDirection = SlideDirection.LEFT; Background = Support.UnicolorSprite("bg", (byte)(LevelManager.Instance.BackgroundColor.R * 255.0f), (byte)(LevelManager.Instance.BackgroundColor.G * 255.0f), (byte)(LevelManager.Instance.BackgroundColor.B * 255.0f), 255); Background.Scale = new Vector2(xScale, yScale); this.AddChild(Background); _okButton = new BetterButton(256.0f, 64.0f) { Text = "okay", Position = Vector2.Zero }; _okButton.background.RegisterPalette(2); // this.AddChild(_okButton); // BIG CIRCLE BULLET POINT ICONS circleOneImg = Support.SpriteFromAtlas("crystallonUI", "1.png"); circleOneImg.Position = new Vector2(CIRCLE_ONE_X, CIRCLE_ONE_Y); circleTwoImg = Support.SpriteFromAtlas("crystallonUI", "2.png"); circleTwoImg.Position = new Vector2(CIRCLE_ONE_X, CIRCLE_ONE_Y - CIRCLE_DELTA_Y); circleThreeImg = Support.SpriteFromAtlas("crystallonUI", "3.png"); circleThreeImg.Position = new Vector2(CIRCLE_ONE_X, CIRCLE_ONE_Y - 2.0f * CIRCLE_DELTA_Y); // DIAGRAMS //--------- ORIENTATION DOESN'T MATTER cubeOneTop = Support.SpriteFromAtlas("gamePieces", "set1_v0_T.png"); cubeOneTop.RegisterPalette(0); cubeOneTop.Position = new Vector2(344.0f, (float)(544-81)); cubeOneTop.Scale = new Vector2(0.66f, 0.66f); cubeOneRight = Support.SpriteFromAtlas("gamePieces", "set1_v0_R.png"); cubeOneRight.RegisterPalette(1); cubeOneRight.Position = new Vector2(386.0f, (float)(544-130)); cubeOneRight.Scale = new Vector2(0.66f, 0.66f); cubeOneLeft = Support.SpriteFromAtlas("gamePieces", "set1_v0_T.png"); cubeOneLeft.RegisterPalette(2); cubeOneLeft.Position = new Vector2(247.0f, (float)(544-114)); cubeOneLeft.Scale = new Vector2(0.66f, 0.66f); //--------- WILDCARD wildcardImg = Support.SpriteFromAtlas("gamePieces", "set1_v0_T.png"); wildcardImg.RegisterPalette(0); wildcardImg.Scale = new Vector2(0.66f, 0.66f); wildcardImg.Position = new Vector2(247.0f, (float)(544-240)); Sequence sequence = new Sequence(); sequence.Add( new CallFunc( () => { wildcardImg.ShiftSpriteColor(QColor.palette[1], 0.08f); }) ); sequence.Add( new DelayTime(0.08f) ); sequence.Add( new CallFunc( () => { wildcardImg.ShiftSpriteColor(QColor.palette[2], 0.08f); }) ); sequence.Add( new DelayTime(0.08f) ); sequence.Add( new CallFunc( () => { wildcardImg.ShiftSpriteColor(QColor.palette[0], 0.08f); }) ); sequence.Add( new DelayTime(0.08f) ); wildcardImg.RunAction( new RepeatForever() { InnerAction=sequence, Tag = 40 } ); //---------- STRIKES heartOne = Support.SpriteFromAtlas("crystallonUI", "heart.png"); heartOne.RegisterPalette(1); heartOne.Position = new Vector2(247.0f, (float)(544-380)); heartTwo = Support.SpriteFromAtlas("crystallonUI", "heart.png"); heartTwo.RegisterPalette(1); heartTwo.Position = new Vector2(304.0f, (float)(544-380)); heartThree = Support.SpriteFromAtlas("crystallonUI", "heart.png"); heartThree.RegisterPalette(1); heartThree.Position = new Vector2(362.0f, (float)(544-380)); strikeFour = Support.SpriteFromAtlas("crystallonUI", "strike.png"); strikeFour.RegisterPalette(2); strikeFour.Position = new Vector2(666.0f, (float)(544-379)); heartFive = Support.SpriteFromAtlas("crystallonUI", "heart.png"); heartFive.RegisterPalette(1); heartFive.Position = new Vector2(716.0f, (float)(544-380)); heartSix = Support.SpriteFromAtlas("crystallonUI", "heart.png"); heartSix.RegisterPalette(1); heartSix.Position = new Vector2(774.0f, (float)(544-380)); cubeTwoTop = Support.SpriteFromAtlas("gamePieces", "set1_v0_T.png"); cubeTwoTop.RegisterPalette(2); cubeTwoTop.Position = new Vector2(491.0f, (float)(544-360)); cubeTwoTop.Scale = new Vector2(0.66f, 0.66f); cubeTwoRight = Support.SpriteFromAtlas("gamePieces", "set1_v0_R.png"); cubeTwoRight.RegisterPalette(1); cubeTwoRight.Position = new Vector2(533.0f, (float)(544-409)); cubeTwoRight.Scale = new Vector2(0.66f, 0.66f); cubeTwoLeft = Support.SpriteFromAtlas("gamePieces", "set1_v0_L.png"); cubeTwoLeft.RegisterPalette(1); cubeTwoLeft.Position = new Vector2(491.0f, (float)(544-409)); cubeTwoLeft.Scale = new Vector2(0.66f, 0.66f); plus = Support.SpriteFromAtlas("crystallonUI", "plus.png"); plus.Color = Colors.Black; plus.Scale = new Vector2(0.66f, 0.66f); plus.Position = new Vector2(432.0f, (float)(544-372)); arrow = Support.SpriteFromAtlas("crystallonUI", "arrow.png"); arrow.Color = Colors.Black; arrow.Scale = new Vector2(0.5f, 0.5f); arrow.Position = new Vector2(607.0f, (float)(544-372)); // equationLabel = new Label() { // Text = "+ =", // Color = Colors.Black, // FontMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), // Position = new Vector2(432.0f, (float)(544-372)) // }; // TEXT LABELS instructionOneLabel = new Label() { Text = INSTRUCTION_ONE_TEXT, Color = Colors.Black, FontMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), Position = new Vector2(453.0f, 466.0f) }; instructionTwoLabel = new Label() { Text = INSTRUCTION_TWO_TEXT, Color = Colors.Black, FontMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), Position = new Vector2(358.0f, 315.0f) }; instructionThreeLabel = new Label() { Text = INSTRUCTION_THREE_TEXT, Color = Colors.Black, FontMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 25, "Bold") ), Position = new Vector2(249.0f, 98.0f) }; this.AddChild(_okButton); this.AddChild(circleOneImg); this.AddChild(circleTwoImg); this.AddChild(circleThreeImg); this.AddChild(cubeOneTop); this.AddChild(cubeOneRight); this.AddChild(cubeOneLeft); this.AddChild(wildcardImg); this.AddChild(heartOne); this.AddChild(heartTwo); this.AddChild(heartThree); this.AddChild(strikeFour); this.AddChild(heartFive); this.AddChild(heartSix); this.AddChild(cubeTwoTop); this.AddChild(cubeTwoRight); this.AddChild(cubeTwoLeft); // this.AddChild(equationLabel); this.AddChild(plus); this.AddChild(arrow); this.AddChild(instructionOneLabel); this.AddChild(instructionTwoLabel); this.AddChild(instructionThreeLabel); }
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); }
// CONSTRUCTOR -------------------------------------------------------------------------------------------------------------------------------------- public InfiniteModeEndPanel() { DismissDelay = 0.0f; Width = 248.0f; Background = Support.UnicolorSprite("white", 255, 255, 255, 255); Background.Scale = new Vector2(Width/16.0f, 128.0f/16.0f); Background.RegisterPalette(0); this.AddChild(Background); // PossibleSolutionsText = new Label() { // Text = "all possible solutions:", // FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold" ) ), // Position = new Vector2(40.0f, 180.0f) // }; // PossibleSolutionsText.RegisterPalette(0); // this.AddChild( PossibleSolutionsText ); // MessageText = new Label() { // Text = "you clever thing.", // FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 32, "Bold" ) ), // }; // MessageText.RegisterPalette(0); // this.AddChild( MessageText ); ReplayButton = new BetterButton(94.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "replay", TextFont = FontManager.Instance.GetInGame("Bariol", 25), Icon = Support.SpriteFromFile("/Application/assets/images/UI/replay.png"), IconAndTextOffset = new Vector2(32.0f, 10.0f), TextOffset = new Vector2(-45.0f, -45.0f), Position = new Vector2(Width - 124.0f, 0.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; ReplayButton.background.RegisterPalette(0); ReplayButton.Icon.Color = LevelManager.Instance.BackgroundColor; ReplayButton.TextColor = LevelManager.Instance.BackgroundColor; this.AddChild(ReplayButton); QuitButton = new BetterButton(94.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "menu", TextFont = FontManager.Instance.GetInGame("Bariol", 25), Icon = Support.SpriteFromFile("/Application/assets/images/UI/arrow.png"), IconAndTextOffset = new Vector2(32.0f, 80.0f), TextOffset = new Vector2(-38.0f, -45.0f), Position = new Vector2(Width - ReplayButton.Width - 124.0f, 0.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; QuitButton.background.RegisterPalette(0); QuitButton.Icon.Color = LevelManager.Instance.BackgroundColor; QuitButton.Icon.Rotation = new Vector2(0.0f, -1.0f); QuitButton.TextColor = LevelManager.Instance.BackgroundColor; this.AddChild(QuitButton); Height = QuitButton.Height; // var charHeight = MessageText.FontMap.CharPixelHeight; // Height = (charHeight * 5.0f) + QuitButton.Height; // MessageText.Position = new Vector2(40.0f, QuitButton.Height + 20 ); // CenterText(); #if DEBUG Console.WriteLine(GetType().ToString() + " created" ); #endif }
protected override void Initialize(bool pStartPaused) { TimeBar2 = Support.UnicolorSprite( "white", 255, 255, 255, 255); base.Initialize (pStartPaused); TimeBar2.Position = TimeBar.Position; TimeBar.RegisterPalette(2); TimeBar2.RegisterPalette(1); TimerIcon.AddChild(TimeBar2); _activeTimeBar.Parent.Children.Reverse(); }
// CONSTRUCTOR -------------------------------------------------------------------------------------------------------------------------------------- public NextLevelPanel() { DismissDelay = 0.0f; Width = 458.0f; Background = Support.UnicolorSprite("white", 255, 255, 255, 255); Background.Scale = new Vector2(448.0f/16.0f, 128.0f/16.0f); Background.RegisterPalette(0); this.AddChild(Background); // MessageText = new Label() { // Text = "you clever thing.", // FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 32, "Bold" ) ), // }; // MessageText.RegisterPalette(0); // this.AddChild( MessageText ); NextLevelButton = new BetterButton(78.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "next", TextFont = FontManager.Instance.GetInGame("Bariol", 25), // IconOnLeft = false, // Icon = Support.SpriteFromFile("/Application/assets/images/UI/arrow.png"), Icon = Support.SpriteFromAtlas("crystallonUI", "arrow.png"), IconAndTextOffset = new Vector2(22.0f, 10.0f), TextOffset = new Vector2(-40.0f, -45.0f), Position = new Vector2(Width - 108.0f, 0.0f), // Color = new Vector4(0.8980f, 0.0745f, 0.0745f, 1.0f) }; NextLevelButton.background.RegisterPalette(0); NextLevelButton.Icon.Color = LevelManager.Instance.BackgroundColor; NextLevelButton.TextColor = LevelManager.Instance.BackgroundColor; // NextLevelButton.Icon.RegisterPalette(1); // NextLevelButton.ButtonLabel.RegisterPalette(1); this.AddChild(NextLevelButton); LevelSelectButton = new BetterButton(80.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "select", Icon = Support.SpriteFromFile("/Application/assets/images/UI/levels.png"), IconAndTextOffset = new Vector2(55.0f, 40.0f), TextOffset = new Vector2(-65.0f, -45.0f), // Icon = Support.SpriteFromAtlas("crystallonUI", "levels.png"), // IconAndTextOffset = new Vector2(30.0f, 10.0f), // TextOffset = new Vector2(-35.0f, -45.0f), TextFont = FontManager.Instance.GetInGame("Bariol", 25), Position = new Vector2(Width - NextLevelButton.Width - 110.0f, 0.0f), }; LevelSelectButton.background.RegisterPalette(0); LevelSelectButton.Icon.Color = LevelManager.Instance.BackgroundColor; LevelSelectButton.TextColor = LevelManager.Instance.BackgroundColor; this.AddChild(LevelSelectButton); ReplayButton = new BetterButton(94.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "replay", TextFont = FontManager.Instance.GetInGame("Bariol", 25), // Icon = Support.SpriteFromFile("/Application/assets/images/UI/replay.png"), Icon = Support.SpriteFromAtlas("crystallonUI", "replay.png"), IconAndTextOffset = new Vector2(32.0f, 10.0f), TextOffset = new Vector2(-45.0f, -45.0f), Position = new Vector2(Width - NextLevelButton.Width - LevelSelectButton.Width - 124.0f, 0.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; ReplayButton.background.RegisterPalette(0); ReplayButton.Icon.Color = LevelManager.Instance.BackgroundColor; ReplayButton.TextColor = LevelManager.Instance.BackgroundColor; // this.AddChild(ReplayButton); QuitButton = new BetterButton(94.0f + 30.0f, Background.CalcSizeInPixels().Y * Background.Scale.Y) { Text = "menu", TextFont = FontManager.Instance.GetInGame("Bariol", 25), // Icon = Support.SpriteFromFile("/Application/assets/images/UI/arrow.png"), Icon = Support.SpriteFromAtlas("crystallonUI", "arrow.png"), IconAndTextOffset = new Vector2(32.0f, 80.0f), TextOffset = new Vector2(-38.0f, -45.0f), Position = new Vector2(Width - NextLevelButton.Width - LevelSelectButton.Width - 124.0f, 0.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; QuitButton.background.RegisterPalette(0); QuitButton.Icon.Color = LevelManager.Instance.BackgroundColor; QuitButton.Icon.Rotation = new Vector2(0.0f, -1.0f); QuitButton.TextColor = LevelManager.Instance.BackgroundColor; // this.AddChild(QuitButton); if(GameScene.currentLevel != 0) { this.AddChild(ReplayButton); } else { this.AddChild(QuitButton); } // DiagonalLine = Support.SpriteFromFile("/Application/assets/images/UI/diagonalLine.png"); DiagonalLine = Support.SpriteFromAtlas("crystallonUI", "diagonalLine.png"); DiagonalLine.Position = new Vector2( QuitButton.Position.X - DiagonalLine.CalcSizeInPixels().X - 5.0f , 15.0f); DiagonalLine.Color = LevelManager.Instance.BackgroundColor; this.AddChild(DiagonalLine); PossibleSolutionsText = new Label() { Text = "solutions\n found", FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 14, "Bold" ) ), Position = new Vector2(15.0f, 80.0f) }; // PossibleSolutionsText.RegisterPalette(0); PossibleSolutionsText.Color = LevelManager.Instance.BackgroundColor; this.AddChild( PossibleSolutionsText ); OutOfText = new Label() { Text = "out of", FontMap = PossibleSolutionsText.FontMap, Position = new Vector2(60.0f, 40.0f) }; OutOfText.Color = LevelManager.Instance.BackgroundColor; this.AddChild( OutOfText ); FoundSolutionsText = new Label() { Text = "00", FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold" ) ), Position = new Vector2(24.0f, 90.0f) }; FoundSolutionsText.Color = LevelManager.Instance.BackgroundColor; this.AddChild(FoundSolutionsText); TotalSolutionsText = new Label{ Text = "00", FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold" ) ), Position = new Vector2(62.0f, 15.0f) }; TotalSolutionsText.Color = LevelManager.Instance.BackgroundColor; this.AddChild(TotalSolutionsText); // var charHeight = MessageText.FontMap.CharPixelHeight; // Height = (charHeight * 5.0f) + QuitButton.Height; Height = QuitButton.Height; // MessageText.Position = new Vector2(40.0f, QuitButton.Height + 20 ); // CenterText(); #if DEBUG Console.WriteLine(GetType().ToString() + " created" ); #endif }
// CONSTRUCTORS ----------------------------------------------------------------------------------------- public MainMenuScreen(MenuSystemScene pMenuSystem) { MenuSystem = pMenuSystem; // var bgcolor = Director.Instance.GL.Context.GetClearColor(); var bgcolor = LevelManager.Instance.BackgroundColor; bgcolor.A = 1.0f; MenuBGTop = Support.SpriteFromFile("/Application/assets/images/UI/menuBtnBG_top.png"); MenuBGTop.Position = new Vector2(351.0f, 436.0f); MenuBGTop.RegisterPalette(1); MaskBGTop = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGTop.Color = bgcolor; MaskBGTop.Position = MenuBGTop.Position.Xy; MaskBGTop.Scale = new Vector2(16.0f, 4.875f); NewGameButton = new BetterButton(256.0f, 64.0f) { Text = "tutorial", Position = new Vector2(94.0f, 372.0f), }; NewGameButton.background.RegisterPalette(1); MaskBGButton1 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGButton1.Color = bgcolor; MaskBGButton1.Position = NewGameButton.Position.Xy; MaskBGButton1.Scale = new Vector2(16.1f, 4.0f); MenuBGSpacer1 = Support.SpriteFromFile("/Application/assets/images/UI/menuBtnBG_blue2.png"); MenuBGSpacer1.Position = new Vector2(351.0f, 285.0f); MenuBGSpacer1.FlipU = true; MenuBGSpacer1.RegisterPalette(2); MaskBGSpacer1 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGSpacer1.Color = bgcolor; MaskBGSpacer1.Position = MenuBGSpacer1.Position.Xy; MaskBGSpacer1.Scale = new Vector2(16.2f, 9.4375f); LevelSelectButton = new BetterButton(256.0f, 64.0f) { Text = "puzzle mode", Position = new Vector2(94.0f, 285.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; LevelSelectButton.background.RegisterPalette(2); MaskBGButton2 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGButton2.Color = bgcolor; MaskBGButton2.Position = LevelSelectButton.Position.Xy; MaskBGButton2.Scale = new Vector2(16.1f, 4.0f); MenuBGSpacer2 = Support.SpriteFromFile("/Application/assets/images/UI/menuBtnBG_red2.png"); MenuBGSpacer2.Position = new Vector2(351.0f, 198.0f); MenuBGSpacer2.FlipU = true; MenuBGSpacer2.RegisterPalette(1); MaskBGSpacer2 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGSpacer2.Color = bgcolor;; MaskBGSpacer2.Position = MenuBGSpacer2.Position.Xy; MaskBGSpacer2.Scale = new Vector2(16.2f, 9.4375f); InstructionsButton = new BetterButton(256.0f, 64.0f) { Text = "challenge mode", Position = new Vector2(94.0f, 198.0f), }; InstructionsButton.background.RegisterPalette(1); MaskBGButton3 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGButton3.Color = bgcolor; MaskBGButton3.Position = InstructionsButton.Position.Xy; MaskBGButton3.Scale = new Vector2(16.1f, 4.0f); MenuBGSpacer3 = Support.SpriteFromFile("/Application/assets/images/UI/menuBtnBG_blue2.png"); MenuBGSpacer3.Position = new Vector2(351.0f, 111.0f); MenuBGSpacer3.FlipU = true; MenuBGSpacer3.RegisterPalette(2); MaskBGSpacer3 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGSpacer3.Color = bgcolor; MaskBGSpacer3.Position = MenuBGSpacer3.Position.Xy; MaskBGSpacer3.Scale = new Vector2(16.2f, 9.4375f); CreditsButton = new BetterButton(256.0f, 64.0f) { Text = "options", Position = new Vector2(94.0f, 111.0f), // Color = new Vector4(0.1608f, 0.8863f, 0.8863f, 1.0f) }; CreditsButton.background.RegisterPalette(2); MaskBGButton4 = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGButton4.Color = bgcolor; MaskBGButton4.Position = CreditsButton.Position.Xy; MaskBGButton4.Scale = new Vector2(16.1f, 4.0f); MenuBGBottom = Support.SpriteFromFile("/Application/assets/images/UI/menuBtnBG_bottom.png"); MenuBGBottom.Position = new Vector2(351.0f, 32.0f); MenuBGBottom.RegisterPalette(1); MaskBGBottom = Support.UnicolorSprite("white", 255, 255, 255, 255); MaskBGBottom.Color = bgcolor; MaskBGBottom.Position = MenuBGBottom.Position.Xy; MaskBGBottom.Scale = new Vector2(16.0f, 4.9375f); this.AddChild(MenuBGBottom); this.AddChild(MaskBGBottom); this.AddChild(MenuBGSpacer3); this.AddChild(MaskBGSpacer3); this.AddChild(MenuBGSpacer2); this.AddChild(MaskBGSpacer2); this.AddChild(MenuBGSpacer1); this.AddChild(MaskBGSpacer1); this.AddChild(MenuBGTop); this.AddChild(MaskBGTop); this.AddChild(NewGameButton); this.AddChild(LevelSelectButton); this.AddChild(InstructionsButton); this.AddChild(CreditsButton); this.AddChild(MaskBGButton1); this.AddChild(MaskBGButton2); this.AddChild(MaskBGButton3); this.AddChild(MaskBGButton4); #if METRICS HoldTimer = 0.0f; PrintAnalyticsButton = new BetterButton(256.0f, 64.0f) { Text = "print metrics", Position = new Vector2(704.0f, 281.0f), Color = new Vector4(0.8980f, 0.0745f, 0.0745f, 1.0f), On = false } ClearAnalyticsButton = new BetterButton(256.0f, 64.0f) { Text = "clear metrics", Position = new Vector2(704.0f, 281.0f), Color = new Vector4(0.8980f, 0.0745f, 0.0745f, 1.0f), On = false } #endif }
protected void Initialize( float pWidth, float pHeight ) { DismissDelay = 1.0f; Height = pHeight; Width = pWidth; var xScale = pWidth/16.0f; var yScale = pHeight/16.0f; SlideInDirection = SlideDirection.UP; SlideOutDirection = SlideDirection.DOWN; Background = Support.UnicolorSprite("Grey", 40, 40, 40, 255); Background.Scale = new Vector2(xScale, yScale); Background.Color = new Vector4(Background.Color.R, Background.Color.G, Background.Color.B, 200.0f/255.0f); this.AddChild(Background); Bar = Support.UnicolorSprite("white", 255, 255, 255, 255); Bar.Scale = new Vector2(xScale, 0.25f); Bar.Position = new Vector2(0.0f, pHeight - 4.0f); Bar.RegisterPalette(0); this.AddChild(Bar); MessageTitleText = new Label() { Text = "Lorem ipsum dolor sit amet, consectetur", FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 32, "Bold") ), // Color = new Vector4(0.161f, 0.886f, 0.886f, 1.0f), Position = new Vector2(40.0f, pHeight - 41.0f) }; MessageTitleText.RegisterPalette(0); this.AddChild(MessageTitleText); MessageText = new Label() { Text = "Lorem ipsum dolor sit amet, consectetur adipisicing \n" + "elit, sed do eiusmod tempor incididunt ut labore et \n" + "dolore magna aliqua. Ut enim ad minim veniam, quis \n"+ "nostrud exercitation ullamco laboris nisi ut aliquip \n" + "ex ea commodo consequat. Duis aute irure dolor in \n", //+ // "reprehenderit in voluptate velit esse cillum dolore eu \n" + // "fugiat nulla pariatur. Excepteur sint occaecat cupidatat \n" + // "non proident, sunt in culpa qui officia deserunt mollit \n" + // "anim id est laborum.", FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25) ), Position = new Vector2(40.0f, pHeight - 69.0f) }; this.AddChild(MessageText); #if DEBUG Console.WriteLine(GetType().ToString() + " created. " + MessageText.Text ); #endif }
private void Initialize() { // Icon = Support.SpriteFromFile("/Application/assets/images/UI/whitePageIcon.png"); Icon = Support.SpriteFromAtlas("crystallonUI", "whitePageIcon.png"); _filled = false; Icon.RegisterPalette(1); this.AddChild(Icon); }
public virtual void setSymbol( int? pSymbol ) { _symbolIndex = pSymbol; if (_symbolIndex == null) { if(_symbol != null) { getNode().RemoveChild(_symbol, true); } _symbol = null; return; } string orient; switch(getOrientation()) { case(0): default: orient = "T"; break; case(1): orient = "L"; break; case(2): orient = "R"; break; } if (_symbol == null) { // _symbol = new SpriteTile(QSymbol.Instance.symbolTiles.TextureInfo); _symbol = new SpriteTile(Support.TextureInfoFromAtlas("symbol", LevelManager.Instance.SymbolPath + "_v" + pSymbol.ToString() + "_" + orient + ".png")); _symbol.Scale = _symbol.CalcSizeInPixels(); _symbol.Position = _symbol.Scale/-2.0f; _symbol.RegisterPalette(_colorIndex); getNode().AddChild(_symbol); } // _symbol.TileIndex2D.X = _orientationIndex; // _symbol.TileIndex2D.Y = _symbolIndex ?? 0; }
public void setAnim( SpriteTile anim, int pStart, int pEnd ) { // REMOVE ANY PREVIOUSLY APPLIED ANIMATION if (_anim != null) { this.getNode().RemoveChild(_anim, true); _anim = null; } // IF SET TO "NO ANIMATION", WE'RE DONE. if (pStart == pEnd) { return; } _anim = new SpriteTile( anim.TextureInfo, anim.TileIndex2D ); _anim.Scale = _anim.CalcSizeInPixels(); _anim.RegisterPalette(_colorIndex); _anim.Position = _anim.Scale/-2.0f; // _anim.Pivot = this.getNode().Pivot; _anim.RunAction( new Support.AnimationAction(_anim, pStart, pEnd, 0.1f*(1+pEnd-pStart), true) ); if (getOrientation() == 2) { _anim.FlipU = true; } this.getNode().AddChild(_anim); }
// CONSTRUCTOR --------------------------------------------------------------------------------------- public LoadingScene(string pDestination, GameSceneData pData = null) { if(pData==null) { pData = DEFAULT_GAME_SCENE_DATA; GAME_SCENE_DATA = pData; } this.Camera.SetViewFromViewport(); stopwatch = Stopwatch.StartNew(); _levelNumber = pData.level; _gameTimer = pData.timeLimit; _angle = 0.0f; _timer = 0.0f; _loadIndex = 0; Hub = new Node(); Hub.Position = new Vector2(480.0f, 272.0f); this.AddChild(Hub); // LoadingSpinner = Support.SpriteFromFile("/Application/assets/images/UI/loading.png"); LoadingSpinner = Support.SpriteFromAtlas("crystallonUI", "loading.png"); LoadingSpinner.Pivot = new Vector2(0.5f, 0.5f); LoadingSpinner.Position = new Vector2(-145.0f, -119.0f); LoadingSpinner.RegisterPalette(1); Hub.AddChild(LoadingSpinner); LoadingText = new Label("loading", UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold"))); LoadingText.Position = new Vector2(445.0f, 257.0f); LoadingText.RegisterPalette(2); this.AddChild(LoadingText); // LOADING PROCEDURE HEADER loadProc = new List<Action>{ () => { ;//dummy }, () => { InputManager.Instance.enabled = false; }, // PRE-LOAD LEVEL DATA () => { LevelManager.Instance.LoadGameData(); } }; switch(pDestination) { case("Level Select"): AddLevelSelectProcs(); break; case("Menu"): AddMenuProcs(); break; case("Game"): default: AddGameProcs(); break; } loadProc.AddRange( new List<Action> { () => { InputManager.Instance.enabled = true; } } ); Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false); }