Ejemplo n.º 1
0
        public void SetWidgetLayout(LayoutOrientation orientation)
        {
            switch (orientation)
            {
            case LayoutOrientation.Vertical:
                this.SetPosition(0, 0);
                this.SetSize(300, 500);
                this.Anchors = Anchors.None;

                download_url.SetPosition(583, 19);
                download_url.SetSize(360, 56);
                download_url.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                download_url.Visible = true;

                DownloadBtn.SetPosition(690, 16);
                DownloadBtn.SetSize(214, 56);
                DownloadBtn.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                DownloadBtn.Visible = true;

                EditableText_1.SetPosition(-99, 108);
                EditableText_1.SetSize(360, 56);
                EditableText_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                EditableText_1.Visible = true;

                EditableText_2.SetPosition(118, 124);
                EditableText_2.SetSize(360, 56);
                EditableText_2.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                EditableText_2.Visible = true;

                break;

            default:
                this.SetPosition(0, 0);
                this.SetSize(500, 300);
                this.Anchors = Anchors.None;

                download_url.SetPosition(49, 30);
                download_url.SetSize(419, 56);
                download_url.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                download_url.Visible = true;

                DownloadBtn.SetPosition(190, 216);
                DownloadBtn.SetSize(126, 56);
                DownloadBtn.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                DownloadBtn.Visible = true;

                EditableText_1.SetPosition(49, 124);
                EditableText_1.SetSize(188, 56);
                EditableText_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                EditableText_1.Visible = true;

                EditableText_2.SetPosition(287, 124);
                EditableText_2.SetSize(181, 56);
                EditableText_2.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                EditableText_2.Visible = true;

                break;
            }
            _currentLayoutOrientation = orientation;
        }
Ejemplo n.º 2
0
        public void SetWidgetLayout(LayoutOrientation orientation)
        {
            switch (orientation)
            {
            case LayoutOrientation.Vertical:
                this.SetPosition(1, 1);
                this.SetSize(400, 640);
                this.Anchors = Anchors.None;

                Button_OK.SetPosition(144, 310);
                Button_OK.SetSize(214, 56);
                Button_OK.Anchors = Anchors.None;
                Button_OK.Visible = true;

                Label_1.SetPosition(23, 36);
                Label_1.SetSize(214, 36);
                Label_1.Anchors = Anchors.None;
                Label_1.Visible = true;

                Text_IP.SetPosition(250, 28);
                Text_IP.SetSize(360, 56);
                Text_IP.Anchors = Anchors.None;
                Text_IP.Visible = true;

                break;

            default:
                this.SetPosition(1, 1);
                this.SetSize(960, 544);
                this.Anchors = Anchors.None;

                Button_OK.SetPosition(766, 397);
                Button_OK.SetSize(193, 146);
                Button_OK.Anchors = Anchors.None;
                Button_OK.Visible = true;

                Label_1.SetPosition(23, 36);
                Label_1.SetSize(214, 36);
                Label_1.Anchors = Anchors.None;
                Label_1.Visible = true;

                Text_IP.SetPosition(268, 27);
                Text_IP.SetSize(209, 54);
                Text_IP.Anchors = Anchors.None;
                Text_IP.Visible = true;

                break;
            }
            _currentLayoutOrientation = orientation;
        }
		public SubmitScore ()
		{
			this.Camera.SetViewFromViewport();
			Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();
			dialog.Width = Director.Instance.GL.Context.GetViewport().Width;
			dialog.Height = Director.Instance.GL.Context.GetViewport().Height;
			
			//textInfo = new TextureInfo(m_texture);
			//SpriteUV tScreen = new SpriteUV(textInfo);
			
			//tScreen.Scale = textInfo.TextureSizef;
			//tScreen.Pivot = new Vector2(0.5f,0.5f);
			//tScreen.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width/2,
			                            //Director.Instance.GL.Context.GetViewport().Height/2);
			//this.AddChild(tScreen);
			
			ImageBox ib = new ImageBox();
			ib.Width = dialog.Width;
			ib.Image = new ImageAsset("/Application/images/highScore.png", false);
			ib.Height = dialog.Height;
			ib.SetPosition(0.0f, 0.0f);
					
			Button submitScore = new Button();
			submitScore.Name = "submitScore";
			submitScore.Text = "Submit Score";
			submitScore.Width = 200;
			submitScore.Height = 50;
			submitScore.Alpha = 0.8f;
			submitScore.SetPosition(250.0f, 40.0f);
			submitScore.TouchEventReceived += OnSubmitScore;
			
			Button returnToMenu = new Button();
			returnToMenu.Name = "returnToMenu";
			returnToMenu.Text = "Menu";
			returnToMenu.Width = 200;
			returnToMenu.Height = 50;
			returnToMenu.Alpha = 0.8f;
			returnToMenu.SetPosition(700.0f, 40.0f);
			returnToMenu.TouchEventReceived += OnButtonPlay;
			
			playerNameField = new EditableText();
			playerNameField.Name = "playerNameField";
			playerNameField.Width = 200;
			playerNameField.Height = 50;
			playerNameField.Alpha = 0.8f;
			playerNameField.SetPosition(25.0f, 40.0f);
			
			UpdateImage(totalScore);
			
			dialog.AddChildLast(ib);
			dialog.AddChildLast(submitScore);
			dialog.AddChildLast(returnToMenu);
			dialog.AddChildLast(playerNameField);
			m_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
			m_uiScene.RootWidget.AddChildLast(dialog);
			UISystem.SetScene(m_uiScene);
			Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
		}
Ejemplo n.º 4
0
        public TitleScreen(Sce.PlayStation.HighLevel.GameEngine2D.Scene scene, Sce.PlayStation.HighLevel.UI.Scene uiScene) : base(scene)
        {
            scene1 = scene;

            textureInfo     = new TextureInfo("/Application/textures/GravityNinja.png");
            sprite          = new SpriteUV();
            sprite          = new SpriteUV(textureInfo);
            sprite.Quad.S   = textureInfo.TextureSizef;
            sprite.Position = new Vector2(0.0f, 0.0f);

            playTexture         = new TextureInfo("/Application/textures/play.png");
            playSelectTexture   = new TextureInfo("/Application/textures/playSelected.png");
            playSprite          = new SpriteUV();
            playSprite          = new SpriteUV(playSelectTexture);
            playSprite.Quad.S   = playTexture.TextureSizef * 0.7f;
            playSprite.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width *0.78f - (playTexture.TextureSizef.X / 2), 200);

            controlTexture         = new TextureInfo("/Application/textures/cog.png");
            controlSprite          = new SpriteUV();
            controlSprite          = new SpriteUV(controlTexture);
            controlSprite.Quad.S   = controlTexture.TextureSizef * 0.05f;
            controlSprite.Position = new Vector2(10.0f, 10.0f);

            playBox.Min = playSprite.Position;
            playBox.Max = playSprite.Position + playSprite.TextureInfo.TextureSizef;

            controlsBox.Min = controlSprite.Position;
            controlsBox.Max = controlSprite.Position + controlSprite.TextureInfo.TextureSizef * 0.05f;

            label = new Sce.PlayStation.HighLevel.UI.Label();
            label.SetPosition(10, 90);
            label.Text = "Awaiting Input...";

            backButton = new Button();
            backButton.SetPosition(10, 140);
            backButton.SetSize(100, 50);
            backButton.Text          = "Back";
            backButton.ButtonAction += HandleButtonAction;

            inputButton = new Button();
            inputButton.SetPosition(380, 10);
            inputButton.SetSize(100, 50);
            inputButton.Text          = "Enter";
            inputButton.ButtonAction += HandleInputAction;

            command = new EditableText();
            command.SetPosition(10, 10);
            command.Text = "Enter Command";

            dialog = new Dialog();
            dialog.SetSize(500, 200);
            dialog.ShowEffect = new BunjeeJumpEffect(dialog, 0.4f);
            dialog.HideEffect = new TiltDropEffect();
            dialog.AddChildFirst(label);
            dialog.AddChildFirst(command);
            dialog.AddChildFirst(backButton);
            dialog.AddChildFirst(inputButton);

            scene.AddChild(sprite);
            scene.AddChild(playSprite);
            scene.AddChild(controlSprite);

            UISystem.SetScene(uiScene);
        }
Ejemplo n.º 5
0
        public HighScoreScene(int highscore)
        {
            m_highscore = highscore;

            this.Camera.SetViewFromViewport();
            Sce.PlayStation.HighLevel.UI.Panel dialog = new Panel();
            dialog.Width  = Director.Instance.GL.Context.GetViewport().Width;
            dialog.Height = Director.Instance.GL.Context.GetViewport().Height;

            ImageBox ib = new ImageBox();

            ib.Width  = dialog.Width;
            ib.Image  = new ImageAsset("/Application/images/title.png", false);
            ib.Height = dialog.Height;
            ib.SetPosition(0.0f, 0.0f);

            // editable text box parameters
            editTextBox.Name   = "editText";
            editTextBox.Text   = "You got a new high score, Enter your name (do not enter ',' or spaces)";
            editTextBox.Width  = 400;
            editTextBox.Height = 100;
            editTextBox.SetPosition(dialog.Width / 2.0f - editTextBox.Width / 2.0f, 220.0f);

            // retrieve highscores
            // retrieve highscore from server
            Client m_client = new Client(new string[1] {
                "Highscorers1234567890"
            });

            string[] highScorers     = new string[10];
            string[] sectionsMessage = m_client.responseMessage.Split(' ');
            highScorers = sectionsMessage[sectionsMessage.Length - 1].Split(',');

            string labelText = "Highscores" + Environment.NewLine +
                               highScorers[0] + ": " + highScorers[1] + Environment.NewLine +
                               highScorers[2] + ": " + highScorers[3] + Environment.NewLine +
                               highScorers[4] + ": " + highScorers[5] + Environment.NewLine +
                               highScorers[6] + ": " + highScorers[7] + Environment.NewLine +
                               highScorers[8] + ": " + highScorers[9] + Environment.NewLine;

            lb.Label highscores = new lb.Label();
            highscores.Name   = "highscores";
            highscores.Text   = labelText;
            highscores.Width  = 300;
            highscores.Height = 400;
            highscores.Alpha  = 0.8f;
            highscores.SetPosition(50, 220.0f);

            // when text box changed - fire event ( change player name and replace scene )
            editTextBox.TextChanged += OnTextEdit;

            dialog.AddChildLast(ib);
            dialog.AddChildLast(editTextBox);
            dialog.AddChildLast(highscores);

            m_uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
            m_uiScene.RootWidget.AddChildLast(dialog);
            m_uiScene.RootWidget.AddChildLast(highscores);

            UISystem.SetScene(m_uiScene);
            Scheduler.Instance.ScheduleUpdateForTarget(this, 0, false);
        }
Ejemplo n.º 6
0
        public void SetWidgetLayout(LayoutOrientation orientation)
        {
            switch (orientation)
            {
            case LayoutOrientation.Vertical:
                this.SetPosition(0, 0);
                this.SetSize(544, 960);
                this.Anchors = Anchors.None;

                Label_1.SetPosition(139, 67);
                Label_1.SetSize(214, 36);
                Label_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                Label_1.Visible = true;

                txtIp.SetPosition(128, 119);
                txtIp.SetSize(360, 56);
                txtIp.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                txtIp.Visible = true;

                txtPort.SetPosition(128, 119);
                txtPort.SetSize(360, 56);
                txtPort.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                txtPort.Visible = true;

                Label_2.SetPosition(139, 67);
                Label_2.SetSize(214, 36);
                Label_2.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                Label_2.Visible = true;

                btn_Connect.SetPosition(31, 180);
                btn_Connect.SetSize(214, 56);
                btn_Connect.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                btn_Connect.Visible = true;

                btn_Cancel.SetPosition(31, 180);
                btn_Cancel.SetSize(214, 56);
                btn_Cancel.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                btn_Cancel.Visible = true;

                break;

            default:
                this.SetPosition(0, 0);
                this.SetSize(500, 240);
                this.Anchors = Anchors.None;

                Label_1.SetPosition(31, 35);
                Label_1.SetSize(333, 36);
                Label_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                Label_1.Visible = true;

                txtIp.SetPosition(31, 81);
                txtIp.SetSize(333, 56);
                txtIp.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                txtIp.Visible = true;

                txtPort.SetPosition(377, 81);
                txtPort.SetSize(95, 56);
                txtPort.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                txtPort.Visible = true;

                Label_2.SetPosition(377, 35);
                Label_2.SetSize(95, 36);
                Label_2.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                Label_2.Visible = true;

                btn_Connect.SetPosition(56, 149);
                btn_Connect.SetSize(180, 56);
                btn_Connect.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                btn_Connect.Visible = true;

                btn_Cancel.SetPosition(258, 149);
                btn_Cancel.SetSize(180, 56);
                btn_Cancel.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
                btn_Cancel.Visible = true;

                break;
            }
            _currentLayoutOrientation = orientation;
        }
        public void SetWidgetLayout(LayoutOrientation orientation)
        {
            switch (orientation)
            {
            case LayoutOrientation.Vertical:
                this.DesignWidth  = 544;
                this.DesignHeight = 960;

                sceneBackgroundPanel.SetPosition(0, 0);
                sceneBackgroundPanel.SetSize(544, 960);
                sceneBackgroundPanel.Anchors = Anchors.Top | Anchors.Bottom | Anchors.Left | Anchors.Right;
                sceneBackgroundPanel.Visible = true;

                CMD_LINE.SetPosition(-52, 394);
                CMD_LINE.SetSize(360, 56);
                CMD_LINE.Anchors = Anchors.None;
                CMD_LINE.Visible = true;

                bg.SetPosition(635, 259);
                bg.SetSize(100, 100);
                bg.Anchors = Anchors.None;
                bg.Visible = true;

                cmd.SetPosition(336, 47);
                cmd.SetSize(214, 36);
                cmd.Anchors = Anchors.None;
                cmd.Visible = true;

                Enter.SetPosition(793, 488);
                Enter.SetSize(214, 56);
                Enter.Anchors = Anchors.None;
                Enter.Visible = true;

                Hack.SetPosition(793, 488);
                Hack.SetSize(214, 56);
                Hack.Anchors = Anchors.None;
                Hack.Visible = false;

                Free.SetPosition(793, 488);
                Free.SetSize(214, 56);
                Free.Anchors = Anchors.None;
                Free.Visible = false;

                break;

            default:
                this.DesignWidth  = 960;
                this.DesignHeight = 544;

                sceneBackgroundPanel.SetPosition(0, 0);
                sceneBackgroundPanel.SetSize(960, 544);
                sceneBackgroundPanel.Anchors = Anchors.Top | Anchors.Bottom | Anchors.Left | Anchors.Right;
                sceneBackgroundPanel.Visible = true;

                CMD_LINE.SetPosition(0, 490);
                CMD_LINE.SetSize(837, 54);
                CMD_LINE.Anchors = Anchors.None;
                CMD_LINE.Visible = true;

                bg.SetPosition(0, 0);
                bg.SetSize(960, 490);
                bg.Anchors = Anchors.None;
                bg.Visible = true;

                cmd.SetPosition(0, 0);
                cmd.SetSize(950, 480);
                cmd.Anchors = Anchors.None;
                cmd.Visible = true;

                Enter.SetPosition(837, 488);
                Enter.SetSize(123, 56);
                Enter.Anchors = Anchors.None;
                Enter.Visible = true;

                Hack.SetPosition(837, 488);
                Hack.SetSize(123, 56);
                Hack.Anchors = Anchors.None;
                Hack.Visible = false;

                Free.SetPosition(837, 488);
                Free.SetSize(123, 56);
                Free.Anchors = Anchors.None;
                Free.Visible = false;

                break;
            }
            _currentLayoutOrientation = orientation;
        }