예제 #1
0
        public void ReInit(ZRaceMeterReinitData inData)
        {
            this.SetDefaults();
            useLocator = inData.useLocator;
            raceMeterScreenPosition = inData.raceMeterScreenPosition;
            raceMarkerStartPos      = Utilities.CGPointMake(inData.raceMeterScreenPosition.x + inData.raceMarkersScreenFrom.x, inData.raceMeterScreenPosition.y + inData.
                                                            raceMarkersScreenFrom.y);
            raceMarkerFinishPos = Utilities.CGPointMake(inData.raceMeterScreenPosition.x + inData.raceMarkersScreenTo.x, inData.raceMeterScreenPosition.y + inData.
                                                        raceMarkersScreenTo.y);
            for (int team = 0; team < numTeams; team++)
            {
                markerPosition[team] = ((float)(numTeams - 1 - team)) * markerSize;
                (pMarker[team]).SetShowScale(inData.markerScale);
                overTakingTimer[team] = 0.0f;
                if (useLocator)
                {
                }

                playerPosition[team] = team;
                playerState[team]    = RMPlayerState.kRMPlayer_Free;
            }

            pRaceTrack.SetPosition(inData.raceMeterScreenPosition);
            pRaceTrack.SetShowScale(inData.scale);
            pRaceTrackLowerHalf.SetShowScale(inData.scale);
            zRotation = 0;
        }
        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);
        }
예제 #3
0
        public void Render()
        {
            if (zobject.atlas == null)
            {
                if (!this.IsOnScreen())
                {
                    this.StopRender();
                }
                else
                {
                    zobject.Render();
                    if (zobjectLabel != null)
                    {
                        CGPoint labePos = Utilities.CGPointMake(zobject.displayPosition.x + labelOffset.x, zobject.displayPosition.y + labelOffset.y);
                        zobjectLabel.SetScreenPosition(labePos);
                        zobjectLabel.Render();
                    }
                }
            }
            else
            {
                if (this.IsOnScreen())
                {
                    ////glEnableClientState (GL_COLOR_ARRAY);
                    (DrawManager.Instance()).Begin(zobject.atlas);
                    if (hangingButton != null)
                    {
                        zobject.SetRotation(hangingButton.UpdateRotation());
                        if (hangingButton != null)
                        {
                            hangingButton.Render(this, zobject.atlas);
                        }

                        if (hangingButton.hangingButtonScale != 1.0f)
                        {
                            zobject.SetShowScale(hangingButton.hangingButtonScale);
                        }

                        zobject.RenderToDrawArrays_Rotatable();
                    }
                    else
                    {
                        zobject.RenderToDrawArrays();
                    }

                    (DrawManager.Instance()).Flush();
                    if (zobjectLabel != null)
                    {
                        CGPoint labePos = Utilities.CGPointMake(zobject.displayPosition.x + labelOffset.x, zobject.displayPosition.y + labelOffset.y);
                        zobjectLabel.SetScreenPosition(labePos);
                        zobjectLabel.RenderFromAtlas();
                    }

                    ////glDisableClientState (GL_COLOR_ARRAY);
                }
                else
                {
                    this.StopRender();
                }
            }
        }
        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);
            }
        }
예제 #5
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);
        }