Code example for Display

Methods: getHeightgetWidth

0
	public void setPosition(float x, float y, Display display) {
		this.position = toPhysicsCoords(x, y, display);
	} 
	 
	public Vec2 toPhysicsCoords(float gestureX, float gestureY, Display display) {
		return new Vec2((20*gestureX)/display.getWidth() - 10, 20 - ((40 * gestureY)/display.getHeight()));
	} 
	 
	private static ByteBuffer extract(Bitmap bmp) { 
		ByteBuffer bb = ByteBuffer.allocateDirect(bmp.getHeight() * bmp.getWidth() * 4); 
		bb.order(ByteOrder.BIG_ENDIAN); 
		IntBuffer ib = bb.asIntBuffer(); 
		// Convert ARGB -> RGBA  
		for (int y = bmp.getHeight() - 1; y > -1; y--) 
		{  
	 
		for (int x = 0; x < bmp.getWidth(); x++) 
		{  
		int pix = bmp.getPixel(x, bmp.getHeight() - y - 1); 
		int alpha = ((pix >> 24) & 0xFF);