Inheritance: CCNode
Exemplo n.º 1
0
        private void CreateButton()
        {
            goToLevelSceneBtn = new Button (gameStartLayer);
            goToLevelSceneBtn.ButtonStyle = ButtonStyle.confirmBtn1;
            goToLevelSceneBtn.btnText = "Start";
            goToLevelSceneBtn.PositionX = gameStartLayer.VisibleBoundsWorldspace.UpperRight.X - 200.0f;
            goToLevelSceneBtn.PositionY = gameStartLayer.VisibleBoundsWorldspace.LowerLeft.Y + 230.0f;
            goToLevelSceneBtn.Clicked += goToLevelSelectScene;
            gameStartLayer.AddChild(goToLevelSceneBtn);

            goToSettingBtn = new Button (gameStartLayer);
            goToSettingBtn.ButtonStyle = ButtonStyle.confirmBtn2;
            goToSettingBtn.btnText="Setting";
            goToSettingBtn.PositionX = gameStartLayer.VisibleBoundsWorldspace.UpperRight.X - 200.0f;
            goToSettingBtn.PositionY = gameStartLayer.VisibleBoundsWorldspace.LowerLeft.Y + 100.0f;
            goToSettingBtn.Clicked += goToSettingScene;
            gameStartLayer.AddChild(goToSettingBtn);
        }
Exemplo n.º 2
0
        private void CreateLayer()
        {
            mBackgroundImage.PositionX = ContentSize.Center.X;
            mBackgroundImage.PositionY = ContentSize.Center.Y;
            mBackgroundImage.IsAntialiased = false;
            this.AddChild (mBackgroundImage);

            mTitle.PositionX = mBackgroundImage.VisibleBoundsWorldspace.Center.X;
            mTitle.PositionY = mBackgroundImage.VisibleBoundsWorldspace.Center.Y + 250;
            mTitle.IsAntialiased = false;
            this.AddChild (mTitle);

            mConfirmBtn = new Button (this);
            mConfirmBtn.ButtonStyle = ButtonStyle.confirmBtn1;
            mConfirmBtn.btnText = "OK";
            mConfirmBtn.PositionX = mBackgroundImage.VisibleBoundsWorldspace.Center.X;
            mConfirmBtn.PositionY = mBackgroundImage.VisibleBoundsWorldspace.Center.Y - 250;
            mConfirmBtn.Clicked += BtnCallBack;
            this.AddChild (mConfirmBtn);
        }