1 /******************************************************************************* 2 * Copyright 2011 See AUTHORS file. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 package com.badlogic.gdx.maps.objects; 18 19 import com.badlogic.gdx.maps.MapObject; 20 import com.badlogic.gdx.math.Ellipse; 21 import com.badlogic.gdx.math.Rectangle; 22 23 /** @brief Represents {@link Ellipse} map objects. */ 24 public class EllipseMapObject extends MapObject { 25 26 private Ellipse ellipse; 27 28 /** @return ellipse shape */ 29 public Ellipse getEllipse () { 30 return ellipse; 31 } 32 33 /** Creates an {@link Ellipse} object whose lower left corner is at (0, 0) with width=1 and height=1 */ 34 public EllipseMapObject () { 35 this(0.0f, 0.0f, 1.0f, 1.0f); 36 } 37 38 /** Creates an {@link Ellipse} object with the given X and Y coordinates along with a specified width and height. 39 * 40 * @param x X coordinate 41 * @param y Y coordinate 42 * @param width Width in pixels 43 * @param height Height in pixels */ 44 public EllipseMapObject (float x, float y, float width, float height) { 45 super(); 46 ellipse = new Ellipse(x, y, width, height); 47 } 48 } 49