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); } }
} ///@property(readwrite,assign) CGPoint position; public FrontEndButton(int buttonId) { //if (!base.init()) return null; hangingButton = null; zobjectLabel = null; goToScreen = FrontEndScreenEnum.kFrontEndScreen_Invalid; myId = buttonId; zobject = new Zobject(); state = ButtonState.EInactive; isClickable = true; actionId = FrontEndActions.kFrontEndAction_None; soundEffectId = (int)Audio.Enum1.kSoundEffect_ButtonPress; flagClicked = false; clickedOneFrame = false; wasPressed = false; isDisabled = false; labelOffset = Utilities.CGPointMake(0, 0); //return this; }
} ///@property(readwrite,assign) FrontEndActions actionId; public void SetGoToScreen(FrontEndScreenEnum inThing) { goToScreen = inThing; } ///@property(readwrite,assign) FrontEndScreenEnum goToScreen;