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); } }
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); } }