LibGDX - Custom Click Listener?

前端 未结 2 2061
旧时难觅i
旧时难觅i 2021-01-07 01:07

I want to make my own Button class, that will have a Sprite, and whenever i touch it it will grow or rotate, etc, the class will have also a Draw and Update function.

<
2条回答
  •  花落未央
    2021-01-07 01:44

    buttonUp = new TextButton("", styleUpButton); //** Button text and style **//
       buttonUp.setPosition(84, 40);
       buttonUp.setHeight(64); 
       buttonUp.setWidth(64); 
       buttonUp.addListener(new InputListener() {
       public boolean touchDown (InputEvent event, float x, float y, int pointer, int button)   {
    HereYouHaveToCallMethodYouNeed();
       return true;
    }
       public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
    //  Here may be onemore method.
       }
    });
    

提交回复
热议问题