All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.brashmonkey.spriter.Dimension Maven / Gradle / Ivy

Go to download

overlap2d-runtime-libgdx provides functionality to load, manipulate and render scenes generated by Overlap2D.

There is a newer version: 0.1.1
Show newest version
package com.brashmonkey.spriter;

/**
 * Represents a dimension in a 2D space.
 * A dimension has a width and a height.
 * @author Trixt0r
 *
 */
public class Dimension {
	
	public float width, height;
	
	/**
	 * Creates a new dimension with the given size.
	 * @param width the width of the dimension
	 * @param height the height of the dimension
	 */
	public Dimension(float width, float height){
		this.set(width, height);
	}
	
	/**
	 * Creates a new dimension with the given size.
	 * @param size the size
	 */
	public Dimension(Dimension size){
		this.set(size);
	}
	
	/**
	 * Sets the size of this dimension to the given size.
	 * @param width the width of the dimension
	 * @param height the height of the dimension
	 */
	public void set(float width, float height){
		this.width = width;
		this.height = height;
	}
	
	/**
	 * Sets the size of this dimension to the given size.
	 * @param size the size
	 */
	public void set(Dimension size){
		this.set(size.width, size.height);
	}
	
	public String toString(){
		return "["+width+"x"+height+"]";
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy