Back to project page catchanimals.
The source code is released under:
GNU General Public License
If you think the Android project catchanimals 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.ricardorb.sprites; // www .j a v a 2 s . c o m import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Rectangle; import com.ricardorb.catchanimals.CatchAnimals; /** * Main class of every object drawed in the game * @author RicardoRB * */ public class Element extends Sprite { protected Rectangle rectangle; protected final CatchAnimals GAME; public Element(final Texture texture){ super(texture); GAME = null; iniRectangle(); } public Element(final Texture texture, final CatchAnimals game) { super(texture); this.GAME = game; iniRectangle(); } public Element(final TextureRegion tRegion,final CatchAnimals game){ super(tRegion); GAME = game; iniRectangle(); } public void dispose(){ getTexture().dispose(); } public void update(){ } public Rectangle getRectangle() { return rectangle; } public void setRectangle(Rectangle rectangle) { this.rectangle = rectangle; } private void iniRectangle() { rectangle = new Rectangle(); rectangle.height = getHeight(); rectangle.width = getWidth(); rectangle.x = getX(); rectangle.y = getY(); } }