Back to project page CircleWorldGDX.
The source code is released under:
MIT License
If you think the Android project CircleWorldGDX 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.fdangelo.circleworld.universeview.objects; //from w w w .j a v a 2 s. c o m import com.badlogic.gdx.math.Rectangle; public class InputAreas { static private Rectangle[] inputAreas = new Rectangle[10]; static private int inputAreasCount; static public void resetInputAreas() { inputAreasCount = 0; } static public void addInputArea(final Rectangle rect) { if (inputAreas[inputAreasCount] == null) { inputAreas[inputAreasCount] = new Rectangle(); } inputAreas[inputAreasCount++] = rect; } static public boolean isInputArea(final float x, final float y) { // Convert from Input coordinate system to GUI coordinate system for (int i = 0; i < inputAreasCount; i++) { if (inputAreas[i].contains(x, y)) { return true; } } return false; } }