public void Show()
        {
            this.Setup();
            speedObject.Show();
            speedObject.QueueAction(ZobjectAction.nThrobLooping);
            speedObject.SetThrobSize(0.05f);
            sheepPic.Show();
            infoBubbleBackground.Show();
            doneButton.Show();
            (doneButton.zobject).QueueAction(ZobjectAction.nThrobLooping);
            for (int i = 0; i < (int)Enum.kNumCommentLines; i++)
            {
                (commentLine [i]).SetFont(Globals.g_world.font);
                (commentLine [i]).SetColour(Constants.kColourLilac);
            }

            float yStart = 62.0f;
            float yPlus  = 40.0f;

            FunnyWord.WordInfo wInfo = new FunnyWord.WordInfo();
            wInfo.position    = Utilities.CGPointMake(160.0f, yStart);
            wInfo.scale       = 0.65f;
            wInfo.isCentrePos = true;
            string inWord = "you just got\n";

            (commentLine [0]).InitWithWordP1(wInfo, inWord);
            yStart        += yPlus;
            wInfo.position = Utilities.CGPointMake(160.0f, yStart);
            SpeedUpProgressEnum speedUp = ((Globals.g_world.frontEnd).profile).speedUpProgress;

            if (speedUp == SpeedUpProgressEnum.kSpeedUp_FirstSpeedBoost)
            {
                (commentLine [1]).SetColour(Constants.kColourLilac);
                inWord = "the turnip\n";
            }
            else if (speedUp == SpeedUpProgressEnum.kSpeedUp_SecondSpeedBoost)
            {
                (commentLine [1]).SetColour(Constants.kColourLilac);
                inWord = "the shear zen\n";
            }
            else if (speedUp == SpeedUpProgressEnum.kSpeedUp_ThirdSpeedBoost)
            {
                (commentLine [1]).SetColour(Constants.kColourLightblue);
                inWord = "the cattle prod\n";
            }
            else
            {
                Globals.Assert(false);
            }

            (commentLine [1]).InitWithWordP1(wInfo, inWord);
            yStart        += yPlus;
            wInfo.position = Utilities.CGPointMake(160.0f, yStart);
            inWord         = "speed boost!\n";
            (commentLine [2]).InitWithWordP1(wInfo, inWord);
            for (int i = 0; i < (int)Enum.kNumCommentLines; i++)
            {
                (commentLine[i]).SetLineAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontLines));
                (commentLine[i]).SetColourAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontColours));
                float showTime = (((float)i) * 0.3f);
                (commentLine[i]).Show(showTime);
                (commentLine[i]).Jiggle(0.5f);
            }
        }
Ejemplo n.º 2
0
        public void SetupCentralButtons(QueryInfoNew qInfo)
        {
            const float kButtonInX = 30;
            const float kButtonUpY = 20;
            CGPoint     querySize  = Utilities.CGPointMake(124.0f, 85.0f);

            float buttonPosY = position.y + ((querySize.y + kButtonUpY) * (scale.y));

            FrontEnd.ButtonInfo info = new FrontEnd.ButtonInfo();
            info.textureLabel = null;
            info.goToScreen   = FrontEndScreenEnum.kFrontEndScreen_Invalid;

            HangingButton.HangingButtonInfo hInfo = new HangingButton.HangingButtonInfo();
            hInfo.showWobbleMultiplier = 1.2f;
            hInfo.type         = HangingButtonType.kHB_Rope;
            hInfo.subTextureId = 0;            //(int)World.Enum6.kSSH_Rope;
            hInfo.offset       = Utilities.CGPointMake(98.0f * qInfo.scale, -15.0f * qInfo.scale);

            buttonPosY += (65.0f * ((float)(qInfo.numButtons - 1)) * qInfo.scale);

            FunnyWord.WordInfo wInfo = new FunnyWord.WordInfo();
            wInfo.isCentrePos = true;
            wInfo.scale       = qInfo.inTextScale * 0.32f;      // * 0.25f;


            for (int i = 0; i < (int)Enum.kMaxCentralButtonsInQuery; i++)
            {
                if (buttonText[i] != null)
                {
                    buttonText[i].Disappear();
                }
                if (button[i] != null)
                {
                    button[i].Disappear();
                }
            }

            for (int buttonIndex = 0; buttonIndex < qInfo.numButtons; buttonIndex++)
            {
                if (buttonText[buttonIndex] == null)
                {
                    buttonText[buttonIndex] = new FunnyWord();
                }

                info.position = Utilities.CGPointMake(position.x, buttonPosY);
                info.texture  = null;
                (button[buttonIndex]).Initialise(info);
                ((button[buttonIndex]).zobject).SetShowScale(scale.x);
                ((button[buttonIndex]).zobject).SetAtlasAndSubtextureP1(atlas, 2);    //qInfo.buttonBackdropId);
                ((button[buttonIndex]).zobject).myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
                (button[buttonIndex]).SetWidth(220.0f);
                (button[buttonIndex]).SetHeight(60.0f);
                (button[buttonIndex]).SetClickStyle(ButtonClickStyle.kButtonClick_Throb);

                (button[buttonIndex]).AddHangingButton(hInfo);
                (button[buttonIndex]).hangingButton.SetWobbleDeclineMultiplier(0.5f);

                ((button[buttonIndex]).zobject).SetShowStyle(ZobjectShowStyle.kZobjectShow_SlideInLeft);
                ((button[buttonIndex]).zobject).SetHideStyle(ZobjectHideStyle.kZobjectHide_SlideToRight);
                ((button[buttonIndex]).zobject).SetHideAcc(0.02f);

                wInfo.position    = info.position;
                wInfo.position.y += 10.0f;

                if (useNSString)
                {
                    buttonText[buttonIndex].InitWithWordNewP1(wInfo, qInfo.buttonString[buttonIndex]);
                }
                else
                {
                    wInfo.scale = qInfo.inTextScale * 0.018f;                    // * 0.1f;// * 0.25f;
                    buttonText[buttonIndex].SetFont(Globals.g_world.font);
                    buttonText[buttonIndex].SetColourAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontColours));
                    buttonText[buttonIndex].InitWithWordP1(wInfo, qInfo.buttonString[buttonIndex]);
                }

                buttonText[buttonIndex].SetPositionZob(((button[buttonIndex]).zobject));
                buttonText[buttonIndex].SetColour(myColour);

                if (useNSString)
                {
                    buttonText[buttonIndex].myTextWrapper.SetBoundThing();
                    buttonText[buttonIndex].SetUseTextureInstead(true);
                    buttonText[buttonIndex].myTextWrapper.SetFontSize(qInfo.inTextScale * 0.32f);
                }
                buttonText[buttonIndex].SetOrientationButton((button[buttonIndex]).hangingButton);

                buttonPosY -= (65.0f * qInfo.scale);
            }
        }