Ejemplo n.º 1
0
        // CONSTRUCTOR ----------------------------------------------------------------------------
        public ButtonEntity( string pLabel, Scene pScene, GamePhysics pGamePhysics, TextureInfo pTextureInfo, Vector2i pTileIndex2D )
            : base(pScene, pGamePhysics, pTextureInfo, pTileIndex2D, null)
        {
            halfWidth = Width / 2.0f;
            halfHeight = Height / 2.0f;
            labelOffset = new Vector2(0.1f, 0.25f);
            this.setPivot(0.5f,0.5f);

            font = Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25);
            map = Crystallography.UI.FontManager.Instance.GetMap( font );
            if ( pLabel != null ) {
                label = new Label( pLabel, map );
                label.Pivot = new Vector2(0.15f, 0.25f );
                label.Scale = new Vector2(1.0f/this.Width,1.0f/this.Height);
            }

            this.getNode().AddChild(label);

            labelOffset = Vector2.Zero;
            status = NORMAL;
            _onToggle = false;
            _pressed = false;
            _initialized = false;

            #if DEBUG
            Console.WriteLine(GetType().ToString() + " created" );
            #endif
        }
Ejemplo n.º 2
0
        // CONSTRUCTORS --------------------------------------------------------------------------------------------------------------------------------
        public TitleScreen(MenuSystemScene pMenuSystem)
        {
            MenuSystem = pMenuSystem;
            FontMap map = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") );

            TitleImage = Support.SpriteFromFile("/Application/assets/images/UI/header.png");
            TouchToStartText = new Label("touch to start", map);
            TouchToStartText.Position = new Vector2(229.0f, 73.0f);
            TouchToStartText.Color = LevelManager.Instance.Palette[0];
            TouchToStartText.Color.A = 0.0f;

            Scheduler.Instance.Schedule( TouchToStartText, (dt) => {
                TouchToStartText.Color.A += 0.25f * dt;
                if (TouchToStartText.Color.A >= 1.0f) {
                    TouchToStartText.Color.A = 1.0f;
                    TouchToStartText.UnscheduleAll();
                }
            }, 0, false, 0);

            this.AddChild(TitleImage);
            this.AddChild(TouchToStartText);

            #if DEBUG
            Console.WriteLine(GetType().ToString() + " created" );
            #endif
        }
Ejemplo n.º 3
0
        // CONSTRUCTOR -----------------------------------------------------------------------
        public Slider(int trackLength=320)
        {
            active = false;

            Title = new Label() {
                FontMap = FontManager.Instance.GetMap( FontManager.Instance.GetInGame("Bariol", 32, "Bold") ),
                Position = new Vector2(-TICK_WIDTH/2.0f, 29.0f),
                Color = Colors.Black
            };
            this.AddChild(Title);

            min = 0.0f;
            max = 100.0f;
            val = min;
            Track = Support.UnicolorSprite("white", 255, 255, 255, 255);
            Track.Scale = new Vector2((float)trackLength/16.0f, 0.625f);
            this.AddChild(Track);
            length = (float)trackLength;

            //			Knob = Support.UnicolorSprite("white", 255, 255, 255, 255);
            //			Knob = Support.SpriteFromFile("/Application/assets/images/UI/sliderLozenge.png");
            Knob = Support.SpriteFromAtlas("crystallonUI", "sliderLozenge.png");
            Knob.CenterSprite(new Vector2(0.5f, 0.36f));
            //			Knob.Position = new Vector2((pValue/(max-min+min))*length, 0.0f);
            this.AddChild(Knob,100);

            bounds = new Bounds2( new Vector2(-20.0f, -20.0f), new Vector2(length+20.0f, 36.0f) );
            #if DEBUG
            Console.WriteLine(GetType().ToString() + " created" );
            #endif
        }
Ejemplo n.º 4
0
 public override void OnExit()
 {
     base.OnExit ();
     TouchToStartText.UnscheduleAll();
     TouchToStartText = null;
     MenuSystem = null;
     Support.RemoveTextureWithFileName("/Application/assets/images/UI/header.png");
 }
Ejemplo n.º 5
0
        // OVERRIDES ---------------------------------------------------------------------------
        public override void OnExit()
        {
            base.OnExit ();

            image = null;
            cubes = null;
            score = null;
        }
Ejemplo n.º 6
0
 // OVERRIDES -----------------------------------------------------------------------------------------------------------------------
 public override void OnExit()
 {
     base.OnExit ();
     this.RemoveAllChildren(true);
     BenIcon = null;
     MegIcon = null;
     NixIcon = null;
     BenText = null;
     MegText = null;
     NixText = null;
     Map = null;
 }
Ejemplo n.º 7
0
        // EVENT HANDLERS -----------------------------------------------------------------------
        // OVERRIDES ----------------------------------------------------------------------------
        public override void OnExit()
        {
            Background = null;
            for( int i=0; i<Icons.Length; i++) {
                Icons[i] = null;
            }
            Icons = null;
            LevelNumberText = null;
            //			Label TapToDismiss = null;
            map = null;
            QualityNames.Clear();

            base.OnExit ();
            RemoveAllChildren(true);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        public override void OnExit()
        {
            ResumeButton.ButtonUpAction -= HandleResumeButtonButtonUpAction;
            GiveUpButton.ButtonUpAction -= HandleGiveUpButtonButtonUpAction;
            InputManager.Instance.StartJustUpDetected -= HandleInputManagerInstanceStartJustUpDetected;
            base.OnExit ();

            Background = null;
            PauseText = null;
            ResetButton = null;
            ResumeButton = null;
            GiveUpButton = null;

            RemoveAllChildren(true);

            InputManager.Instance.StartJustUpDetected -= HandleInputManagerInstanceStartJustUpDetected;
        }
Ejemplo n.º 10
0
        // CONSTRUCTOR ---------------------------------------------------------------------------------------------------------------------
        public CreditsPanel()
        {
            Map = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 36, "Regular") );

            BenIcon = Support.SpriteFromFile("/Application/assets/images/UI/icons/tie.png");
            BenIcon.Position = new Vector2(302.0f, 184.0f);
            this.AddChild( BenIcon );

            BenText = new Label(){
                Text = "ben johnson",
                Position = new Vector2(113.0f, 186.0f),
                Color = Colors.White,
                FontMap = Map
            };
            this.AddChild( BenText );

            MegIcon = Support.SpriteFromFile("/Application/assets/images/UI/icons/phones.png");
            MegIcon.Position = new Vector2(536.0f, 96.0f);
            this.AddChild( MegIcon );

            MegText = new Label(){
                Text = "margaret schedel",
                Position = new Vector2(272.0f, 100.0f),
                Color = Colors.White,
                FontMap = Map
            };
            this.AddChild( MegText );

            NixIcon = Support.SpriteFromFile("/Application/assets/images/UI/icons/glasses.png");
            NixIcon.Position = new Vector2(595.0f, 184.0f);
            this.AddChild( NixIcon );

            NixText = new Label(){
                Text = "phoenix perry",
                Position = new Vector2(385.0f, 186.0f),
                Color = Colors.White,
                FontMap = Map
            };
            this.AddChild( NixText );
        }
Ejemplo n.º 11
0
        // CONSTRUCTOR -------------------------------------------------------------------------
        public SolutionIcon()
            : base()
        {
            //			image = Support.SpriteFromFile("/Application/assets/images/UI/cubePoints.png");
            //			image = Support.SpriteFromFile("/Application/assets/images/UI/ratioIcon.png");
            image = Support.SpriteFromAtlas("crystallonUI", "ratioIcon.png");
            AddChild(image);

            cubes = new Label(){
                Position = new Vector2(30.0f, 17.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 16, "Bold") )
            };
            cubes.Color = image.Color;
            AddChild(cubes);

            score = new Label(){
                Position = new Vector2(30.0f, 53.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 16, "Bold") )
            };
            score.Color = image.Color;
            AddChild(score);
        }
Ejemplo n.º 12
0
        public ScorePanel( ICrystallonEntity pEntity, int pPoints )
        {
            InitializeWidget();

            ScoreLabel = new Sce.PlayStation.HighLevel.GameEngine2D.Label() {
                Text = pPoints.ToString()
            };
            var font = new Font("Application/assets/fonts/Bariol_Regular.otf", 25, FontStyle.Regular);
            var map = new FontMap(font);
            ScoreLabel.FontMap = map;
            ScoreLabel.Position = new Vector2(-4.0f, 10.0f);
            ScoreLabel.Color = Colors.White;
            ScoreLabel.HeightScale = 1.0f;
            ScoreLabel.Pivot = new Vector2(0.5f, 0.5f);
            Sequence sequence = new Sequence();
            sequence.Add( new DelayTime( 0.5f ) );
            sequence.Add ( new CallFunc( () => { pEntity.getNode().Parent.AddChild(ScoreLabel); } ) );

            //			ScoreText.Font = FontManager.Instance.Get ("Bariol", 20, "Bold");
            //			ScoreText.Text = pPoints.ToString();
            //			ScoreText.Alpha = 0.0f;
            //			_scoreTexture = new Texture2D((int)ScoreText.Width, (int)ScoreText.Height, false, PixelFormat.Rgba);
            //			ScoreText.RenderToTexture(_scoreTexture);
            //			_scoreTextureInfo = new TextureInfo(_scoreTexture);
            //			_scoreSprite = new SpriteUV(_scoreTextureInfo);
            //			_scoreSprite.Pivot = new Vector2(0.5f, 0.5f);
            //			pEntity.getNode().AddChild(_scoreSprite);
            //			_scoreSprite.Position = new Vector2(0.0f, 20.0f);
            //			Vector2 v = ConvertScreenToLocal( pPosition );
            //			this.SetPosition( v.X - ScoreText.Width/2, Director.Instance.GL.Context.GetViewport().Height - (v.Y + 40) );
            //			Sequence sequence = new Sequence();
            //			sequence.Add( new DelayTime( 3.0f ) );
            //			sequence.Add ( new CallFunc( () => {
            //				ScoreText.Visible = false;
            //				this.Dispose();
            //			} ) );
            Director.Instance.CurrentScene.RunAction(sequence);
        }
 // METHODS ------------------------------------------------------------------------------------------------------------------------------
 protected void CenterText( Label pLabel )
 {
     var textWidth = Crystallography.UI.FontManager.Instance.GetInGame("Bariol", (int)pLabel.FontMap.CharPixelHeight, "Bold").GetTextWidth(pLabel.Text);
     pLabel.Position = new Vector2(593 + 0.5f * (367 - textWidth), pLabel.Position.Y);
 }
        // CONSTRUCTOR ----------------------------------------------------------------------------------------------------------------------
        public LevelSelectScreen(MenuSystemScene pMenuSystem)
        {
            SelectedLevel = 0;
            var init = ColorIcon.Instance;
            MenuSystem = pMenuSystem;

            var pages = FMath.Ceiling((GameScene.TOTAL_LEVELS-1) / (float)LevelPage.ITEMS_PER_PAGE);

            Panels = new List<Node>{};

            for (int i=0; i < pages; i++) {
                Panels.Add( new LevelPage(i) );
                (Panels[i] as LevelPage).Disable();
            }
            (Panels[0] as LevelPage).Enable();

            this.SwipePanels = new SwipePanels(Panels) {
                Width = 457.0f,
                Position = new Vector2(95.0f,46.0f)
            };

            Indicator = new LevelSelectIndicator();

            // BLACK MASKS TO HIDE MORE LEVELS BEHIND
            BlackBlock1 = Support.UnicolorSprite("white", 255,255,255,255);
            BlackBlock1.Color = Support.ExtractColor("333330");
            BlackBlock1.Scale = new Vector2(361.0f/16.0f, Director.Instance.GL.Context.Screen.Height/16.0f);
            BlackBlock1.Position = new Vector2(Director.Instance.GL.Context.Screen.Width-361.0f, 0.0f);

            BlackBlock2 = Support.UnicolorSprite("white", 255,255,255,255);
            BlackBlock2.Color = LevelManager.Instance.BackgroundColor;
            BlackBlock2.Position = Vector2.Zero;
            BlackBlock2.Scale = new Vector2(50.0f/16.0f, Director.Instance.GL.Context.Screen.Height/16.0f);

            BlackBlock3 = Support.UnicolorSprite("white", 255,255,255,255);
            BlackBlock3.Color = Support.ExtractColor("333330");
            BlackBlock3.Scale = new Vector2(361.0f/16.0f, 115.0f/16.0f);
            BlackBlock3.Position = new Vector2(Director.Instance.GL.Context.Screen.Width-361.0f, Director.Instance.GL.Context.Screen.Height - 115.0f);

            BlackBlock4 = Support.UnicolorSprite("white", 255,255,255,255);
            BlackBlock4.Color = Support.ExtractColor("333330");
            BlackBlock4.Scale = new Vector2(361.0f/16.0f, 253.0f/16.0f);
            BlackBlock4.Position = new Vector2(Director.Instance.GL.Context.Screen.Width-361.0f, 0.0f);

            LevelNumberText = new Label(){
                Text = SelectedLevel.ToString(),
                Position = new Vector2(Director.Instance.GL.Context.Screen.Width-339.0f, Director.Instance.GL.Context.Screen.Height-78.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 64, "Bold") ),
                Color = LevelManager.Instance.BackgroundColor
            };
            //			CenterText(LevelNumberText);

            //			SolutionPanel = new HudPanel(){
            //			};

            PossibleSolutionsText = new Label(){
                Text = "possible solutions",
                Position = new Vector2(Director.Instance.GL.Context.Screen.Width - 339.0f, Director.Instance.GL.Context.Screen.Height-100.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") ),
                Color = LevelManager.Instance.BackgroundColor
            };

            Solutions = new SolutionSlider();

            //			Solutions = new List<SolutionIcon>(); //{
            //				new SolutionIcon(){
            //					CubeText = "99",
            //					ScoreText = "88"
            //				},
            //				new SolutionIcon(){
            //					CubeText = "99",
            //					ScoreText = "88"
            //				},
            //				new SolutionIcon(){
            //					CubeText = "99",
            //					ScoreText = "88"
            //				},
            //				new SolutionIcon(){
            //					CubeText = "99",
            //					ScoreText = "88"
            //				},
            //				new SolutionIcon(){
            //					CubeText = "99",
            //					ScoreText = "88"
            //				}
            //			};
            //			for( int i=0; i < Solutions.Count; i++) {
            //				Solutions[i].Visible = false;
            //				var column = i % 4;
            //				var row = ( i - column ) / 4;
            //				Solutions[i].Position = new Vector2(Director.Instance.GL.Context.Screen.Width - 339.0f + 60.0f * column,
            //				                                    Director.Instance.GL.Context.Screen.Height - 200.0f - row * 80.0f);
            //				this.AddChild(Solutions[i]);
            //			}

            QualitiesText = new Label() {
                Text = "qualities",
                Position = new Vector2(623.0f, 223.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") ),
                Color = LevelManager.Instance.BackgroundColor
            };

            //			CompletionPercentageText = new Label() {
            //				Text = (1.0f).ToString("P0"),
            //				Position = new Vector2(638.0f, 150.0f),
            //				FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") ),
            ////				Color = new Vector4( 0.16078431f, 0.88627451f, 0.88627451f, 1.0f)
            //			};
            //			CenterText(CompletionPercentageText);
            //			this.AddChild(CompletionPercentageText);

            Icons = new Node[4];
            IconLabels = new Label[4];
            for( int i=0; i < Icons.Length; i++) {
                Icons[i] = Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2);
                Icons[i].Position = new Vector2(623.0f + 68.0f * (float)i, 2.0f * BUTTON_HEIGHT + 20.0f);
            //				Icons[i].Scale = new Vector2(0.25f, 0.25f);
                IconLabels[i] = new Label() {
                    FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 36, "Bold") ),
                    Color = LevelManager.Instance.BackgroundColor
                };
            }

            LevelSelectTitleText = new Label(){
                Text="level select",
                Position = new Vector2(50.0f, 488.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 36, "Regular") ),
                Color = Support.ExtractColor("333330")
            };

            LevelSelectInstructionsText = new Label(){
                Text="select a cube and then press play.",
                Position = new Vector2(50.0f, 465.0f),
                FontMap = UI.FontManager.Instance.GetMap(Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Regular") ),
                Color = Support.ExtractColor("333330")
            };

            BackButton = new BetterButton(361.0f, BUTTON_HEIGHT) {
                Text = "back",
                Position = new Vector2(Director.Instance.GL.Context.Screen.Width-361.0f, BUTTON_HEIGHT)
            };
            BackButton.background.RegisterPalette(2);

            PlayButton = new BetterButton(361.0f, BUTTON_HEIGHT) {
                Text = "play",
                Position = new Vector2(Director.Instance.GL.Context.Screen.Width-361.0f, 0.0f)
            };
            PlayButton.background.RegisterPalette(1);

            // SWIPE LAYER
            this.AddChild(this.SwipePanels);
            foreach( LevelPage panel in Panels) {
                this.AddChild(panel);
            }
            (Panels[0] as LevelPage).Items[0].AddChild(Indicator);

            // UI LAYERS
            BackLayer = new Layer();
            this.AddChild(BackLayer);
            FrontLayer = new Layer();
            this.AddChild(FrontLayer);

            // BACK LAYER ELEMENTS
            BackLayer.AddChild(BlackBlock1);
            BackLayer.AddChild(BlackBlock2);
            BackLayer.AddChild(Solutions);

            // FRONT LAYER ELEMENTS
            FrontLayer.AddChild(BlackBlock3);
            FrontLayer.AddChild(BlackBlock4);

            FrontLayer.AddChild(LevelNumberText);
            FrontLayer.AddChild(PossibleSolutionsText);
            FrontLayer.AddChild(QualitiesText);
            for( int i=0; i < Icons.Length; i++) {
                FrontLayer.AddChild(Icons[i]);
            }
            FrontLayer.AddChild(LevelSelectTitleText);
            FrontLayer.AddChild(LevelSelectInstructionsText);
            FrontLayer.AddChild(BackButton);
            FrontLayer.AddChild(PlayButton);
        }
        public override void OnExit()
        {
            ColorIcon.Destroy();
            BackButton.UnregisterPalette();
            PlayButton.UnregisterPalette();
            LevelSelectItem.LevelSelectionDetected -= HandleLevelSelectItemLevelSelectionDetected;
            BackButton.ButtonUpAction -= HandleBackButtonButtonUpAction;
            PlayButton.ButtonUpAction -= HandlePlayButtonButtonUpAction;
            this.SwipePanels.OnSwipeComplete -= HandleSwipePanelshandleOnSwipeComplete;

            base.OnExit ();

            MenuSystem = null;
            Panels.Clear();
            this.SwipePanels = null;
            LevelSelectTitleText = null;
            LevelSelectInstructionsText = null;

            BlackBlock1 = null;
            BlackBlock2 = null;

            BackButton = null;
            PlayButton = null;

            for (int i=0; i < Icons.Length; i++){
                Icons[i] = null;
            }
            Icons = null;
            //			Solutions.Clear();
            Solutions = null;
        }
        public override void OnExit()
        {
            _okButton.ButtonUpAction -= Handle_okButtonButtonUpAction;

            _okButton = null;
            circleOneImg = null;
            circleTwoImg = null;
            circleThreeImg = null;
            wildcardImg = null;
            cubeOneTop = null;
            cubeOneRight = null;
            cubeOneLeft = null;
            heartOne = null;
            heartTwo = null;
            heartThree = null;
            strikeFour = null;
            heartFive = null;
            heartSix = null;
            plus = null;
            arrow = null;
            cubeTwoTop = null;
            cubeTwoRight = null;
            cubeTwoLeft = null;
            instructionOneLabel = null;
            instructionTwoLabel = null;
            instructionThreeLabel = null;

            RemoveAllChildren(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);
        }
Ejemplo n.º 18
0
        // 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
        }
Ejemplo n.º 19
0
        // 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;
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Initialize the specified pWidth and pHeight.
        /// </summary>
        /// <param name='pWidth'>
        /// Desired button width in pixels.
        /// </param>
        /// <param name='pHeight'>
        /// Desired button height in pixels.
        /// </param>
        public void Initialize(float pWidth, float pHeight)
        {
            Width = pWidth;
            Height = pHeight;
            _textOffset = Vector2.Zero;
            _iconAndTextOffset = Vector2.Zero;
            Vector2 size = new Vector2(pWidth, pHeight);

            _status = NORMAL;
            _onToggle = true;
            _pressed = false;
            _bounds = new Bounds2(Vector2.Zero, size);

            // DEFAULT BACKGROUND IMAGE
            if (background == null) {
                background = Support.TiledSpriteFromFile("/Application/assets/images/UI/BetterButton.png", 1, 3);
                background.Scale = size / DefaultDimensions;
            }
            this.AddChild(background);

            // DEFAULT BUTTON TYPEFACE
            if (_textFont == null) {
                _textFont = Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 36, "Bold");
            }
            var map = Crystallography.UI.FontManager.Instance.GetMap( _textFont );

            _buttonText = new Label() {
                Text = "",
                FontMap = map,
                Position = new Vector2(0.0f, 0.5f * (Height - map.CharPixelHeight) )
            };
            this.AddChild(_buttonText);

            ScheduleUpdate(0);
            #if DEBUG
            Console.WriteLine(GetType().ToString() + " created" );
            #endif
        }
Ejemplo n.º 21
0
 public override void OnExit()
 {
     background = null;
     _icon = null;
     _buttonText = null;
     _textFont = null;
     base.OnExit ();
     RemoveAllChildren(true);
     InputManager.Instance.TouchJustDownDetected -= HandleInputManagerInstanceTouchJustDownDetected;
     InputManager.Instance.TouchJustUpDetected -= HandleInputManagerInstanceTouchJustUpDetected;
 }
Ejemplo n.º 22
0
        public UI()
        {
            // アドホックに描画する関数を指定する
            this.AdHocDraw += this.Draw;

            // ラベルの作成
            BossDamage = new Sce.PlayStation.HighLevel.GameEngine2D.Label ();
            PlayerDamage = new Sce.PlayStation.HighLevel.GameEngine2D.Label ();

            // TrueTypeフォントの読み込み
            Font = new Font ("/Application/assets/IndieFlower.ttf", 48, FontStyle.Bold);
            FontMap = new FontMap (Font);

            // フォントの設定
            BossDamage.FontMap = FontMap;
            PlayerDamage.FontMap = FontMap;

            // ラベル表示位置設定
            BossDamage.Position = new Vector2 (120.0f, Game.Instance.ScreenSize.Y - 40);
            PlayerDamage.Position = new Vector2 (120.0f, Game.Instance.ScreenSize.Y - 80);

            // ラベルをNodeに追加(ラベルが表示される)
            this.AddChild (BossDamage);
            this.AddChild (PlayerDamage);
        }
        public override void OnExit()
        {
            ReplayButton.ButtonUpAction -= HandleReplayButtonButtonUpAction;
            QuitButton.ButtonUpAction -= HandleQuitButtonButtonUpAction;
            OnSlideInComplete -= HandleOnSlideInComplete;
            OnSlideOutComplete -= HandleOnSlideOutComplete;
            OnSlideOutStart -= HandleOnSlideOutStart;
            OnSlideInStart -= HandleOnSlideInStart;

            Background = null;
            MessageText = null;
            PossibleSolutionsText = null;
            QuitButton = null;
            ReplayButton = null;

            CleanUpSolutions();

            base.OnExit ();
            RemoveAllChildren(true);
        }
        //        protected SpriteTile _cubeIcon;
        //        protected SpriteTile _scoreIcon;
        //        protected SpriteTile _timeIcon;
        // CONSTRUCTOR ------------------------------------------
        public InfiniteModeScreen(MenuSystemScene pMenuSystem)
        {
            MenuSystem = pMenuSystem;

            var map = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 25, "Bold") );

            _bestCubes = _bestPoints = 0;
            _bestTime = 0.0f;

            _timeLimitText = new Label() {
                FontMap = map,
                Color = Colors.Black
            };
            //			_timeLimitText.RegisterPalette(0);
            this.AddChild(_timeLimitText);

            timeLimitSlider = new Slider(540) {
                Text = "time limit",
                Position = new Vector2(33.0f, 440.0f),
                max = 60.0f,
                min = 5.0f,
                discreteOptions = new List<float>() { 5.0f, 10.0f, 20.0f, 35.0f, 60.0f },
                OnChange = (unused) => {
                    if ( timeLimitSlider.Value != timeLimitSlider.max ) {
                        _timeLimitText.Text = timeLimitSlider.Value.ToString() + " minutes";
                        _bestTitleText.Text = _timeLimitText.Text;
                        if(_highScoreEntries != null) {
            //							_highScoreEntries[0].ShowBestTime(false);
                            _highScoreEntries[0].BestCubes = DataStorage.timedCubes[timeLimitSlider.SelectedOption,0,0];
                            _highScoreEntries[0].BestPoints = DataStorage.timedScores[timeLimitSlider.SelectedOption,0,1];
                        }
                    } else {
                        _timeLimitText.Text = "infinite";
                        if(_highScoreEntries != null) {
            //							_highScoreEntries[0].ShowBestTime(true);

                            _highScoreEntries[0].BestCubes = DataStorage.infiniteCubes[0,0];
                            _highScoreEntries[0].BestPoints = DataStorage.infiniteScores[0,1];
            //							_highScoreEntries[0].BestTime = DataStorage.infiniteTimes[0,2];
                        }
                    }
                }
            };
            timeLimitSlider.AddTickmarks();
            timeLimitSlider.RegisterPalette(2);
            timeLimitSlider.SetSliderValue( (float)DataStorage.options[4] );
            this.AddChild(timeLimitSlider);

            //			_timeLimitText.Position = new Vector2(timeLimitSlider.Position.X + timeLimitSlider.Length + 20.0f, timeLimitSlider.Position.Y);
            _timeLimitText.Position = new Vector2(timeLimitSlider.Position.X + 4.0f, timeLimitSlider.Position.Y - 41.0f);

            //			_fourthQualityText = new Label() {
            //				FontMap = map
            //			};
            //			_fourthQualityText.RegisterPalette(1);
            //			this.AddChild(_fourthQualityText);

            //			fourthQualitySlider = new Slider() {
            //				Text = "fourth quality",
            //				Position = new Vector2(timeLimitSlider.Position.X, timeLimitSlider.Position.Y - 100.0f),
            //				max = 2.0f,
            //				min = 0.0f,
            //				discreteOptions = new List<float>() { 0.0f, 1.0f, 2.0f },
            //				OnChange = (unused) => {
            //					switch(fourthQualitySlider.Value.ToString("#0.#")) {
            //					case("0"):
            //						_fourthQualityText.Text = "none";
            //						break;
            //					case("1"):
            //						_fourthQualityText.Text = "particles";
            //						break;
            //					case("2"):
            //						_fourthQualityText.Text = "sound";
            //						break;
            //					}
            //				}
            //			};
            //			fourthQualitySlider.AddTickmarks();
            //			fourthQualitySlider.RegisterPalette(1);
            //			fourthQualitySlider.SetSliderValue( 1.0f );
            ////			this.AddChild(fourthQualitySlider);
            //
            //			_fourthQualityText.Position = new Vector2(fourthQualitySlider.Position.X + fourthQualitySlider.Length + 20.0f, fourthQualitySlider.Position.Y);
            //
            _fourthQualityTitle = new Label() {
                Text = "bonus quality",
                FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 32, "Bold") ),
                Position = new Vector2(33.0f, 326.0f),
                Color = Colors.Black
            };
            this.AddChild(_fourthQualityTitle);

            _buttonHighlight = Support.UnicolorSprite("Black", 0,0,0,255);
            _buttonHighlight.Scale = new Vector2(10.8125f, 12.125f);
            this.AddChild(_buttonHighlight);

            _soundButton = new BetterButton(173.0f, 176.0f) {
                Text = "sound",
                TextFont = FontManager.Instance.GetInGame("Bariol", 25, "Bold"),
                Icon = Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2),
                IconAndTextOffset = new Vector2(31.0f, 17.0f),
                TextOffset = new Vector2(-58.0f, -50.0f),
                Position = new Vector2(33.0f, 109.0f)
            };
            _soundButton.Icon.TileIndex1D = 4;
            _soundButton.background.RegisterPalette(0);
            _soundButton.Icon.Color = LevelManager.Instance.BackgroundColor;
            this.AddChild(_soundButton);

            _particleButton = new BetterButton(173.0f, 176.0f) {
                Text = "particles",
                TextFont = FontManager.Instance.GetInGame("Bariol", 25, "Bold"),
                Icon = Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2),
                IconAndTextOffset = new Vector2(31.0f, 17.0f),
                TextOffset = new Vector2(-58.0f, -50.0f),
                Position = new Vector2(216.0f, 109.0f)
            };
            _particleButton.Icon.TileIndex1D = 2;
            _particleButton.background.RegisterPalette(1);
            _particleButton.Icon.Color = LevelManager.Instance.BackgroundColor;
            this.AddChild(_particleButton);

            _noneButton = new BetterButton(173.0f, 176.0f) {
                Text = "none",
                TextFont = FontManager.Instance.GetInGame("Bariol", 25, "Bold"),
                Icon = Support.TiledSpriteFromFile("/Application/assets/images/icons/icons.png", 4, 2),
                IconAndTextOffset = new Vector2(31.0f, 17.0f),
                TextOffset = new Vector2(-64.0f, -50.0f),
                Position = new Vector2(399.0f, 109.0f)
            };
            _noneButton.Icon.TileIndex1D = 6;
            _noneButton.background.RegisterPalette(2);
            this.AddChild(_noneButton);

            _instructionsButton = new BetterButton(362.0f, 62.0f) {
                Text = "instructions",
                Position = Vector2.Zero
            };
            _instructionsButton.background.RegisterPalette(2);
            this.AddChild(_instructionsButton);

            _bestBG = Support.UnicolorSprite("black", 0,0,0,255);
            _bestBG.Position = new Vector2(598.0f, 0.0f);
            _bestBG.Scale = new Vector2(22.625f, 34.0f);
            this.AddChild(_bestBG);

            _bestTitleText = new Label() {
                Text = _timeLimitText.Text,
                FontMap = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 32, "Bold") ),
                Position = new Vector2(_bestBG.Position.X + 41.0f, 465.0f)
            };
            //			_bestTitleText.RegisterPalette(2);
            _bestTitleText.Color = LevelManager.Instance.BackgroundColor;
            this.AddChild(_bestTitleText);

            _highScoreEntries = new HighScoreEntry[3];
            _highScoreEntries[0] = new HighScoreEntry() {
                BestCubes = DataStorage.infiniteCubes[0,0],
                BestPoints = DataStorage.infiniteCubes[0,1],
            //				BestTime = (float)DataStorage.infiniteCubes[0,2],
                Position = new Vector2(_bestTitleText.Position.X, _bestTitleText.Position.Y - 316.0f)
            };
            //			_highScoreEntries[1] = new HighScoreEntry() {
            //				BestCubes = DataStorage.infiniteScores[0,0],
            //				BestPoints = DataStorage.infiniteScores[0,1],
            //				BestTime = (float)DataStorage.infiniteScores[0,2],
            //				Position = new Vector2(_bestTitleText.Position.X, _bestTitleText.Position.Y - 120)
            //			};
            //			_highScoreEntries[2] = new HighScoreEntry() {
            //				BestCubes = DataStorage.infiniteTimes[0,0],
            //				BestPoints = DataStorage.infiniteTimes[0,1],
            //				BestTime = (float)DataStorage.infiniteTimes[0,2],
            //				Position = new Vector2(_bestTitleText.Position.X, _bestTitleText.Position.Y - 180)
            //			};
            //			for(int i=0; i<3; i++){
            //				this.AddChild(_highScoreEntries[i]);
            //			}
            this.AddChild(_highScoreEntries[0]);

            cancelButton = new BetterButton(362.0f, 62.0f) {
                Text = "main menu",
                Position = new Vector2(598.0f, 62.0f)
            };
            cancelButton.background.RegisterPalette(1);
            this.AddChild(cancelButton);

            playButton = new BetterButton(362.0f, 62.0f) {
                Text = "play",
                Position = new Vector2(598.0f, 0.0f)
            };
            playButton.background.RegisterPalette(0);
            this.AddChild(playButton);

            _instructionsPanel = new ChallengeModeInstructionsPanel();
            this.AddChild(_instructionsPanel);
        }
Ejemplo n.º 25
0
 public void SetQualityNames( string[] pNames )
 {
     foreach ( Label l in QualityNames) {
         this.RemoveChild(l, true);
     }
     QualityNames.Clear();
     Label n;
     int i = 0;
     foreach(SpriteTile icon in Icons) {
         icon.Visible = false;
     }
     foreach ( string name in pNames ) {
         Icons[i].TileIndex1D = (int)EnumHelper.FromString<Crystallography.Icons>(name);
         Icons[i].Visible = true;
         QualityNames.Add( n = new Label() );
         n.Color = Colors.White;
         n.FontMap = map;
         n.Text = name;
         n.Position = new Vector2( Icons[i].Position.X, Icons[i].Position.Y - 20.0f ); //(QualityNames.Count-1)*80.0f, -25.0f);
         this.AddChild(n);
         i++;
     }
 }
Ejemplo n.º 26
0
        public override void OnExit()
        {
            base.OnExit ();
            InputManager.Instance.TouchJustDownDetected -= HandleInputManagerInstanceTouchJustDownDetected;
            InputManager.Instance.TouchJustUpDetected -= HandleInputManagerInstanceTouchJustUpDetected;
            InputManager.Instance.TouchDownDetected -= HandleInputManagerInstanceTouchDownDetected;

            Knob = null;
            Track = null;
            Title = null;
            Ticks = null;
        }
Ejemplo n.º 27
0
 private void CenterCubeScoreText(Label pLabel, Vector2 pAnchor)
 {
     float x = pAnchor.X - 0.5f * FontManager.Instance.GetInGame("Bariol", 44, "Bold").GetTextWidth(pLabel.Text);
     pLabel.Position = new Vector2(x, pAnchor.Y);
 }
Ejemplo n.º 28
0
        // METHODS ------------------------------------------------------------------------------------------------------------
        protected void Initialize()
        {
            _initialized = true;
            FontMap map = Crystallography.UI.FontManager.Instance.GetMap( Crystallography.UI.FontManager.Instance.GetInGame("Bariol", 44, "Bold") );

            Background = Support.UnicolorSprite("black", 0, 0, 0, 255);
            Background.Position = new Vector2(298.0f, 97.0f);
            Background.Scale = new Vector2(22.125f, 22.125f);

            PauseText = new Label("paused", map) {
                Position = new Vector2(415.0f, 342.0f),
                Color = LevelManager.Instance.BackgroundColor
            };

            GiveUpButton = new BetterButton(354.0f, 61.0f) {
                Text = "quit",
                Position = Background.Position
            };
            GiveUpButton.background.RegisterPalette(2);
            GiveUpButton.On(false);

            ResetButton = new BetterButton(354.0f, 61.0f) {
                Text = "restart",
                Position = new Vector2(GiveUpButton.Position.X, GiveUpButton.Position.Y + GiveUpButton.Height),
            };
            ResetButton.background.RegisterPalette(1);
            ResetButton.On(false);

            ResumeButton = new BetterButton(354.0f, 61.0f) {
                Text = "resume",
                Position = new Vector2(ResetButton.Position.X, ResetButton.Position.Y + ResetButton.Height)
            };
            ResumeButton.background.RegisterPalette(0);
            ResumeButton.On (false);

            this.AddChild(Background);
            this.AddChild(PauseText);
            this.AddChild(ResetButton);
            this.AddChild(ResumeButton);
            this.AddChild(GiveUpButton);

            #if DEBUG
            Console.WriteLine(GetType().ToString() + " created" );
            #endif
        }
Ejemplo n.º 29
0
        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;
        }
Ejemplo n.º 30
0
        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
        }