예제 #1
0
    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);
    }
예제 #2
0
 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);
 }
예제 #3
0
 public void setCallback(void_function_empty f)
 {
     function_empty_action  = f;
     function_button_action = null;
 }
예제 #4
0
 public void setCallback(void_function_DyanmicButton f)
 {
     function_empty_action  = null;
     function_button_action = f;
 }
예제 #5
0
 //getters and setters for the callback function
 public void setCallback()
 {
     function_empty_action  = null;
     function_button_action = null;
 }