Back to project page diploma-assignment.
The source code is released under:
MIT License
If you think the Android project diploma-assignment listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.me.battlescreen; // w ww. j a v a 2 s. c o m import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.scenes.scene2d.Actor; public class MyButton extends Actor{ protected Texture texture; protected boolean pressed; public MyButton(Texture t){ texture=t; pressed=false; } @Override public void draw(Batch batch,float alpha){ if(pressed){ batch.setColor(Color.GRAY); } batch.draw(texture, getX(), getY(), getWidth(), getHeight()); batch.setColor(Color.WHITE); } public void setPressed(boolean p) { pressed=p; } public boolean isPressed() { return pressed; } public void setTexture(Texture texture2) { texture=texture2; } }