【发布时间】:2018-03-10 07:34:29
【问题描述】:
我正在尝试创建一个按下时会缩放的按钮。
textureAtlas = assetManager.get("btn.txt", TextureAtlas.class);
skin = new Skin(textureAtlas);
btnStyle = new Button.ButtonStyle();
btnStyle.up = howToBtn_skin.getDrawable("button");
btnStyle.down = howToBtn_skin.getDrawable("button_pushed");
myButton = new Button(btnStyle);
howToBtn.setPosition((Constant.WIDTH / 2) - 41, (Constant.HEIGHT / 2 - 150));
“按钮” - 是较小的一个
“button_pushed” - 较大的一个
该按钮在单击时会切换图像,但不会根据图像大小进行缩放。所以当用户点击按钮时,看起来什么都没有发生,因为按钮的大小保持不变。
【问题讨论】: