예제 #1
0
        public void StartAppearing()
        {
            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.position    = Utilities.GetScreenCentre();
            info.isMapObject = false;
            info.startState  = ZobjectState.kZobjectHidden;
            info.texture     = pTexture;
            zobject.Initialise(info);
            switch (type)
            {
            case TransitionType.e_Invisible:
                this.StartTransition_Fade();
                zobject.SetTexture(null);
                break;

            case TransitionType.e_Fade:
                this.StartTransition_Fade();
                break;

            case TransitionType.e_WhirlingShape:
                this.StartTransition_WhirlingShape();
                break;
            }

            zobject.Show();
        }
예제 #2
0
        public void InitialiseMovingObject(ZbarInfoMoving info)
        {
            type             = BarType.e_MovingObject;
            fillLevel        = 0;
            fillMaximum      = 100;
            displayFillLevel = 0;
            startPosition    = info.startPosition;
            endPosition      = info.endPosition;
            position         = startPosition;
            if (zobject == null)
            {
                zobject = new Zobject();
            }

            Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
            zInfo.position    = position;
            zInfo.texture     = info.texture[0];
            zInfo.startState  = ZobjectState.kZobjectShown;
            zInfo.isMapObject = false;
            zobject.Initialise(zInfo);
            currentAnim   = 0;
            inTextures[0] = info.texture[0];
            inTextures[1] = info.texture[1];
            inTextures[2] = info.texture[2];
        }
예제 #3
0
        public void StartTransition_WhirlingShape()
        {
            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.position    = Utilities.GetScreenCentre();
            info.isMapObject = false;
            info.startState  = ZobjectState.kZobjectHidden;
            info.texture     = pBackTexture;
            spinningWord.Initialise(info);
            spinningWord.SetStretchToScreen(false);
            spinningWord.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_SpinIn);
            spinningWord.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_SpinOut);
            spinningWord.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            spinningWord.SetShowLagSpeed(0.4f);
            spinningWord.Show();
            spinningWord.SetShowLagSpeed(0.4f);

/*			Zobject.ZobjectInfo info = new Zobject.ZobjectInfo() ;
 *          info.position = Utilities.GetScreenCentre();
 *          info.isMapObject = false;
 *          info.startState = ZobjectState.kZobjectHidden;
 *          info.texture = pBackTexture;
 *          zobject.Initialise(info);
 *                      zobject.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
 *                      zobject.SetStretchToScreen(true);
 *          zobject.SetShowStyle((int) ZobjectShowStyle.kZobjectShow_FadeIn);
 *          zobject.SetHideStyle((int) ZobjectHideStyle.kZobjectHide_FadeOut);
 *          zobject.Show();*/
        }
예제 #4
0
        public void Setup(AppleWonInfo info)
        {
            timeBetweenApples = info.timeBetweenApples;
            for (int i = 0; i < 3; i++)
            {
                Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
                zInfo.texture = info.texture;
                float xPos = (((float)i) * info.distanceBetweenApples);
                zInfo.position    = Utilities.CGPointMake(info.position.x + xPos, info.position.y);
                zInfo.isMapObject = false;
                zInfo.startState  = ZobjectState.kZobjectHidden;
                //zInfo.texture= null;
                zInfo.mapScrollPosition = Utilities.CGPointMake(0, 0);

                (apple[i]).Initialise(zInfo);
                (apple[i]).SetShowLagSpeed(0.9f);
                (apple[i]).SetShowStyle(ZobjectShowStyle.kZobjectShow_ZoomAndWobble);
                (apple[i]).SetShowScale(info.appleScale);
                // (apple[i]).SetAtlasAndSubtextureP1(Globals.g_world.GetAtlas(AtlasType.kAtlas_AppleSign),0);
                if (info.soundEffectId != -1)
                {
                    (apple[i]).SetSoundEffectIdAppear((int)info.soundEffectId);
                }

                apple[i].myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }
        }
예제 #5
0
        public void InitialiseP1(FrontEnd.ButtonInfo buttonInfo, int inShowStyle)
        {
            this.SetDefaults();
            sparklesPosition = 0;
            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.position    = buttonInfo.position;
            info.texture     = buttonInfo.texture;
            normalTexture    = info.texture;
            info.startState  = ZobjectState.kZobjectHidden;
            info.isMapObject = false;
            zobject.Initialise(info);
            zobject.SetShowStyle(inShowStyle);
            zobject.SetThrobSize(0.1f);
            zobject.SetThrobTime(0.16f);
            position = buttonInfo.position;
            if (buttonInfo.texture != null)
            {
                width  = (float)(buttonInfo.texture).pixelsWide;
                height = (float)(buttonInfo.texture).pixelsHigh;
            }

            if (Globals.g_main.usingTextureResolution == TextureResolutionEnum.kTextureResolution_High)
            {
                width  /= 2.0f;
                height /= 2.0f;
            }


            goToScreen = buttonInfo.goToScreen;
            zobject.SetAtlas(null);
            //buttonInfo.textureLabel = null;
            if (buttonInfo.textureLabel != null)
            {
                if (zobjectLabel == null)
                {
                    zobjectLabel = new Zobject();
                }

                info.texture = buttonInfo.textureLabel;
                zobjectLabel.Initialise(info);
                zobjectLabel.SetShowStyle(inShowStyle);
            }
        }
예제 #6
0
        public void Initialise(ZscoreInfo zInfo)
        {
            position     = zInfo.position;
            score        = 0;
            prevScore    = -1;
            displayScore = score;
            Globals.Assert((zInfo.numDigits <= 5) && (zInfo.numDigits > 0));
            numDigits = zInfo.numDigits;
            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.texture     = digitTexture [0];
            info.startState  = ZobjectState.kZobjectHidden;
            info.isMapObject = false;
            for (int i = 0; i < (int)Enum.kMaxNumScoreDigits; i++)
            {
                (zobject[i]).Initialise(info);
            }

            this.SetPosition(position);
        }
예제 #7
0
        public void AddLabelP1(Texture2D_Ross inTex, CGPoint inOffset)
        {
            labelOffset = inOffset;
            if (zobjectLabel == null)
            {
                zobjectLabel = new Zobject();
            }

            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.texture    = inTex;
            info.startState = ZobjectState.kZobjectHidden;
            zobjectLabel.Initialise(info);
            zobjectLabel.SetShowStyle(zobject.showStyle);
            zobjectLabel.SetHideStyle(zobject.hideStyle);
            zobjectLabel.SetWaitToShow(zobject.waitToShow);
            CGPoint labePos = Utilities.CGPointMake(position.x + labelOffset.x, position.y + labelOffset.y);

            zobjectLabel.SetScreenPosition(labePos);
            zobjectLabel.SetState(ZobjectState.kZobjectHidden);
        }
예제 #8
0
        public void FirstInitialisation(ZRaceMeterData inData)
        {
            Globals.Assert(inData.numTeams <= (int)Enum.kMaxNumTeams);
            numTeams = inData.numTeams;
            Zobject.ZobjectInfo info = new Zobject.ZobjectInfo();
            info.isMapObject = false;
            info.startState  = ZobjectState.kZobjectShown;
            info.position    = inData.position;
            for (int team = 0; team < numTeams; team++)
            {
                if (pMarker[team] == null)
                {
                    pMarker[team] = new Zobject();
                }

                info.texture = null;
                (pMarker[team]).Initialise(info);
                (pMarker[team]).SetAtlas(inData.atlas);
                (pMarker[team]).SetSubTextureId(inData.subtextureId[team]);
                pMarker[team].myAtlasBillboard.SetRenderQueue(11000);
                pMarker[team].myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }

            if (pRaceTrack == null)
            {
                pRaceTrack          = new Zobject();
                pRaceTrackLowerHalf = new Zobject();
            }

            info.texture = null;
            pRaceTrack.Initialise(info);
            pRaceTrack.SetAtlas(inData.atlas);
            pRaceTrack.SetSubTextureId(1);
            pRaceTrackLowerHalf.Initialise(info);
            pRaceTrackLowerHalf.SetAtlas(inData.atlas);
            pRaceTrackLowerHalf.SetSubTextureId(2);
            pRaceTrack.myAtlasBillboard.SetRenderQueue(11000);
            pRaceTrackLowerHalf.myAtlasBillboard.SetRenderQueue(11000);
            pRaceTrack.myAtlasBillboard.myObject.layer          = LayerMask.NameToLayer("guistuff");
            pRaceTrackLowerHalf.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
        }
        public void InitialiseZobjects()
        {
            Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
            zInfo.position = Utilities.CGPointMake(160.0f, 225.0f);
            zInfo.texture  = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_BubbleBack);
            infoBubbleBackground.Initialise(zInfo);
            infoBubbleBackground.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_Immediate);
            infoBubbleBackground.SetShowScale((320.0f / 256.0f));
            FrontEnd.ButtonInfo bInfo = new FrontEnd.ButtonInfo();
            bInfo.position   = Utilities.CGPointMake(160.0f, 430.0f);
            bInfo.texture    = (Globals.g_world.frontEnd).GetButtonTexture((int)FrontEnd.Enum.kButtonTexture_StartGame);
            bInfo.goToScreen = FrontEndScreenEnum.kFrontEndScreen_Invalid;
            doneButton.Initialise(bInfo);
            (doneButton.zobject).SetShowStyle((int)ZobjectShowStyle.kZobjectShow_SlideInBottom);
            (doneButton.zobject).SetHideStyle((int)ZobjectHideStyle.kZobjectHide_SlideToBottom);
            (doneButton.zobject).SetThrobSize(0.075f);
            (doneButton.zobject).SetThrobTime(0.4f);
            zInfo.texture  = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTextureApple);
            zInfo.position = Utilities.CGPointMake(160.0f, 205.0f);
            zInfo.texture  = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTextureTurnip);
            speedObject.Initialise(zInfo);
            SpeedUpProgressEnum speedUp = ((Globals.g_world.frontEnd).profile).speedUpProgress;

            if (speedUp == SpeedUpProgressEnum.kSpeedUp_ThirdSpeedBoost)
            {
                speedObject.SetShowScale(1.0f);
            }
            else
            {
                speedObject.SetShowScale(0.7f);
            }

            speedObject.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_ZoomAndWobble);
            zInfo.position = Utilities.CGPointMake(160.0f, 298.0f);
            zInfo.texture  = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTextureTurnipSheep);
            sheepPic.Initialise(zInfo);
            sheepPic.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_FadeIn);
            zInfo.position = Utilities.CGPointMake(220.0f, 400.0f);
            zInfo.texture  = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTextureTurnipSheepShadow);
        }
        public void Initialise(SlideInCharacterInfo inInfo)
        {
            yPos = inInfo.yPos;
            for (int i = 0; i < 2; i++)
            {
                (commentLine[i]).SetFont(Globals.g_world.font);
                (commentLine[i]).SetLineAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontLines));
                (commentLine[i]).SetColourAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontColours));
            }

            Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
            zInfo.position    = Utilities.CGPointMake(160, inInfo.yPos);
            zInfo.texture     = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_PiggySpeechBubble);
            zInfo.startState  = ZobjectState.kZobjectHidden;
            zInfo.isMapObject = false;
            speechBubble.Initialise(zInfo);
            speechBubble.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_SlideInTop);
            speechBubble.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_SlideToTop);
            speechBubble.SetShowScale(1.1f);
            if (inInfo.side == (int)SlideInSide.eLeft)
            {
                zInfo.position = Utilities.CGPointMake(55, inInfo.yPos + 80.0f);
            }
            else
            {
                zInfo.position = Utilities.CGPointMake(260, inInfo.yPos + 80.0f);
            }

            if (inInfo.whichCharacter == (int)PlayerType.kPlayerPig)
            {
                zInfo.texture = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_PiggyHeadFE);
            }
            else
            {
                zInfo.texture = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_SheepyHead);
            }

            zInfo.startState  = ZobjectState.kZobjectHidden;
            zInfo.isMapObject = false;
            character.Initialise(zInfo);
            if (inInfo.side == (int)SlideInSide.eLeft)
            {
                character.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_SlideInLeft);
                character.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_SlideToLeft);
            }
            else
            {
                character.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_SlideInRight);
                character.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_SlideToRight);
            }

            character.SetShowScale(0.6f);
            if (inInfo.side == (int)SlideInSide.eLeft)
            {
                speechBubble.SetHorizontallyFlipped(true);
            }
            else
            {
                speechBubble.SetHorizontallyFlipped(false);
            }
        }
예제 #11
0
        public void InitialiseNew(QueryInfoNew info)
        {
            waitToHide = 0.0f;

            if (unityText == null)
            {
                unityText = new FunnyWord();
            }

            if (info.numButtons > 0)
            {
                myColour = Constants.kColourRed;
            }

            if (Globals.g_main.usingTextureResolution == TextureResolutionEnum.kTextureResolution_High)
            {
                info.inTextScale *= 2.0f;
            }

            if (Globals.g_world.DoesCurrentLanguageUseNSString() || info.useNSStringForAnyLanguage)
            {
                useNSString = true;
            }
            else
            {
                useNSString = false;
            }

            FunnyWord.WordInfo wInfo;
            wInfo.position    = info.position;
            wInfo.isCentrePos = true;
            wInfo.scale       = info.inTextScale * 0.32f;      // * 0.25f;

            if (useNSString)
            {
                unityText.InitWithWordNewP1(wInfo, info.queryText);
            }
            else
            {
                position = info.position;
                this.DivideStringIntoFunnyWords(info.queryText);

                wInfo.scale = info.inTextScale * 0.012f;                // * 0.1f;// * 0.25f;
                //unityText.SetFont(Globals.g_world.font);
                //unityText.SetColourAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontColours));
                //unityText.InitWithWordP1(wInfo,info.queryText);
            }

            unityText.SetColour(myColour);

            if (useNSString)
            {
                unityText.myTextWrapper.SetBoundThing();
                unityText.SetUseTextureInstead(true);
                unityText.myTextWrapper.SetFontSize(info.inTextScale * 0.32f);
            }

            newStyleWithAtlas = info.newStyleWithAtlas;
            newStyleQuery     = true;
            useActualText     = false;
            FrontEndQuery.QueryInfo qInfo = new FrontEndQuery.QueryInfo();
            qInfo.noButton  = info.noButton;
            qInfo.yesButton = info.yesButton;
            position        = info.position;
            state           = QueryState.e_Inactive;
            chosenButton    = (QueryButton)(-1);
            queryText       = (info.queryText);
            boxDimensions   = Utilities.CGPointMake(info.boxDimensions.Width, info.boxDimensions.Height);
            scale.x         = info.scale;
            scale.y         = info.scale;
            atlas           = info.inAtlas;
            if (newStyleWithAtlas)
            {
                this.SetupButtonsNew(info);
            }

            Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
            if (newStyleWithAtlas)
            {
                zInfo.texture = null;
            }
            else
            {
                zInfo.texture = info.backdropTexture;
            }

            zInfo.startState  = ZobjectState.kZobjectHidden;
            zInfo.position    = position;
            zInfo.isMapObject = false;
            backdrop.Initialise(zInfo);
            backdrop.SetShowScale(scale.x * 1.2f);
            if (newStyleWithAtlas)
            {
                backdrop.SetAtlasAndSubtextureP1(atlas, info.backdropId);
            }
            else
            {
//                backdrop.SetShowScale(1.2f);
            }

            if (backdrop.myAtlasBillboard != null)
            {
                backdrop.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }

            numButtons     = info.numButtons;
            zInfo.position = Utilities.CGPointMake(160.0f, 240.0f);
            zInfo.texture  = info.dimOverlayTexture;
            dimZob.Initialise(zInfo);
            dimZob.SetStretchToScreen(true);
            dimZob.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_FadeIn);
            dimZob.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_FadeOut);
            dimZob.SetShowAlpha(0.7f);
            if (newStyleWithAtlas)
            {
                dimZob.SetAtlasAndSubtextureP1(atlas, info.dimId);
            }

            if (dimZob.myAtlasBillboard != null)
            {
                dimZob.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }


            if (textTexture != null)
            {
            }

            CGSize dimensionsForText = info.boxDimensions;
            float  textScale         = info.inTextScale;

            if (Globals.deviceIPad)
            {
                dimensionsForText.Height *= 2.0f;
                dimensionsForText.Width  *= 2.0f;
                textScale *= 2.0f;
            }

            textTexture    = null;         //new Texture2D_Ross(info.queryText, dimensionsForText, UITextAlignment.UITextAlignmentCenter, "Arial", textScale);
            zInfo.texture  = textTexture;
            zInfo.position = position;
            if (Globals.g_currentLanguage == World.Enum11.kLanguage_Japanese)
            {
                if ((!Globals.deviceIPhone4) && (!Globals.deviceIPad))
                {
                    zInfo.position.y += 3.0f;
                }
                else
                {
                    zInfo.position.y += 15.0f;
                }
            }

            text.Initialise(zInfo);
            text.SetShowScale(scale.x);

            if (text.myAtlasBillboard != null)
            {
                text.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }


            if (!newStyleWithAtlas)
            {
                boxDimensions.x = 200.0f;
                boxDimensions.y = 180.0f;
                if (info.numButtons == 0)
                {
                    this.SetupButtons(qInfo);
                }
            }


            if (info.numButtons > 0)
            {
                queryButtonStyle = QueryButtonStyle.kQButtonsCentral;
                this.SetupCentralButtons(info);

                //This means we want the new style central hanging buttons
            }
            else
            {
                queryButtonStyle = QueryButtonStyle.kQButtonsEdges;
            }

            backdrop.SetShowStyle(ZobjectShowStyle.kZobjectShow_SlideInLeft);
            backdrop.SetHideStyle(ZobjectHideStyle.kZobjectHide_SlideToRight);
            backdrop.SetHideAcc(0.02f);

            unityText.SetPositionZob(backdrop);
        }
예제 #12
0
        public void Initialise(QueryInfo info)
        {
            waitToHide    = 0.0f;
            newStyleQuery = false;
            for (int i = 0; i < (int)Enum.kMaxFunnyWordsInQuery; i++)
            {
                if (funnyWord[i] == null)
                {
                    funnyWord[i] = new FunnyWord();
                }

                (funnyWord[i]).Disappear();
            }

            state         = QueryState.e_Inactive;
            chosenButton  = (QueryButton)(-1);
            useActualText = info.useActualText;
            theInfo1      = info.theInfo1;
            theInfo2      = info.theInfo2;
            theInfo3      = info.theInfo3;
            theInfo4      = info.theInfo4;
            theInfo5      = info.theInfo5;
            theInfo6      = info.theInfo6;
            theInfo7      = info.theInfo7;
            position      = info.position;
            boxDimensions = info.boxDimensions;
            if (info.backdropTexture == null)
            {
                scale.x = boxDimensions.x / 128;
                scale.y = boxDimensions.y / 128;
            }
            else
            {
                scale.x = 1.0f;
                scale.y = 1.0f;
            }

            this.SetupButtons(info);
            Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo();
            zInfo.texture     = info.backdropTexture;
            zInfo.startState  = ZobjectState.kZobjectHidden;
            zInfo.position    = position;
            zInfo.isMapObject = false;
            backdrop.Initialise(zInfo);
            backdrop.SetShowScale(scale.x);
            if (zInfo.texture != null)
            {
                backdrop.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff");
            }


            zInfo.texture  = info.dimTexture;
            zInfo.position = Utilities.CGPointMake(160.0f, 240.0f);
            dimZob.Initialise(zInfo);
            dimZob.SetStretchToScreen(true);
            dimZob.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_FadeIn);
            dimZob.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_FadeOut);
            dimZob.SetShowAlpha(0.9f);
            zInfo.texture  = info.textTexture;
            zInfo.position = Utilities.CGPointMake(position.x, position.y - 40);
            text.Initialise(zInfo);
            text.SetShowScale(scale.x);
        }