public void init() { //create play game function void_function_DyanmicButton f = directConnectCallback; DynamicButton temp = new DynamicButton(assets, new Rect(SizeMaster.IndentButtonMiddle, SizeMaster.ScreenTitleRect.y + SizeMaster.SpacingButtonHalf * 3, SizeMaster.standardButtonSize.x, SizeMaster.standardButtonSize.y * 2f), "Play Game", DyanimcButtonStyle.playCard, standardTextSize, f, assets.playCardIdle, assets.playCardPressed); temp.setPositionToValue(2f); temp.setTargetPosition(new Vector2(SizeMaster.IndentButtonMiddle, SizeMaster.ScreenTitleRect.y + SizeMaster.SpacingButtonHalf * 3)); //temp.setAsNew(15); //temp.setAsWinner(10); drawableComponents.Add(temp); //create quit button temp = new DynamicButton(assets, new Rect(SizeMaster.IndentButtonMiddle, SizeMaster.ScreenTitleRect.y + SizeMaster.SpacingButtonHalf * 5, SizeMaster.standardButtonSize.x, SizeMaster.standardButtonSize.y * 2), "Quit Game", DyanimcButtonStyle.playCard, standardTextSize, quitGameCallback, assets.playCardIdle, assets.playCardPressed); drawableComponents.Add(temp); }
public DynamicButton(AssetManager a, Rect r, string t, DyanimcButtonStyle s, int ts, void_function_DyanmicButton f, Texture2D idle, Texture2D pressed) : base(new Vector2(r.x, r.y)) { assets = a; function_button_action = f; init(r, t, s, ts, idle, pressed); }
public void setCallback(void_function_empty f) { function_empty_action = f; function_button_action = null; }
public void setCallback(void_function_DyanmicButton f) { function_empty_action = null; function_button_action = f; }
//getters and setters for the callback function public void setCallback() { function_empty_action = null; function_button_action = null; }