@Test public void testGetObjectGroups() { Assert.assertEquals(2, tiledMap.getTotalObjectGroups()); TiledObjectGroup group = tiledMap.getObjectGroup("Objects"); Assert.assertEquals("Objects", group.getName()); Assert.assertEquals(3, group.getObjects().size); for (int i = 0; i < group.getObjects().size; i++) { TiledObject obj = group.getObjects().get(i); switch (obj.getName()) { case "test1": Assert.assertEquals(true, obj.containsProperty("testProperty")); Assert.assertEquals("SUCCESS", obj.getProperty("testProperty")); Assert.assertEquals(32f, obj.getX(), 0f); Assert.assertEquals(64f, obj.getY(), 0f); Assert.assertEquals(16f, obj.getWidth(), 0f); Assert.assertEquals(24f, obj.getHeight(), 0f); break; case "test2": Assert.assertEquals(true, obj.containsProperty("testProperty")); Assert.assertEquals("SUCCESS2", obj.getProperty("testProperty")); Assert.assertEquals(260f, obj.getX(), 0f); Assert.assertEquals(192f, obj.getY(), 0f); Assert.assertEquals(24f, obj.getWidth(), 0f); Assert.assertEquals(16f, obj.getHeight(), 0f); break; case "flipped_tile_object": Assert.assertEquals(288f, obj.getX(), 0f); Assert.assertEquals(96f, obj.getY(), 0f); Assert.assertEquals(32f, obj.getWidth(), 0f); Assert.assertEquals(32f, obj.getHeight(), 0f); Assert.assertEquals(156, obj.getGid()); Assert.assertEquals(false, obj.isGidFlipDiagonally()); Assert.assertEquals(true, obj.isGidFlipHorizontally()); Assert.assertEquals(true, obj.isGidFlipVertically()); break; } } }
public Iterable<TiledObjectGroup> getObjectGroups() { return tiledMapData.getObjectGroups(); }
TiledMap { public Iterable<TiledObjectGroup> getObjectGroups() { return tiledMapData.getObjectGroups(); } }
TiledMap { public Iterable<TiledObjectGroup> getObjectGroups() { return tiledMapData.getObjectGroups(); } TiledMap(FileHandle fileHandle);  TiledMap(FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledParser parser, FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledMapData tiledMapData, boolean loadTilesetTextures); }
TiledMap { public Iterable<TiledObjectGroup> getObjectGroups() { return tiledMapData.getObjectGroups(); } TiledMap(FileHandle fileHandle);  TiledMap(FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledParser parser, FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledMapData tiledMapData, boolean loadTilesetTextures); boolean isTilesetTexturesLoaded(); boolean isTilesetTexturesLoaded(boolean ignoreObjectTemplateTilesets); boolean loadTilesetTextures(); boolean loadTilesetTextures(AssetManager assetManager); boolean loadTilesetTextures(TextureAtlas textureAtlas); boolean loadTilesetTextures(boolean loadObjectTemplateTilesets); boolean loadTilesetTextures(AssetManager assetManager, boolean loadObjectTemplateTilesets); boolean loadTilesetTextures(TextureAtlas textureAtlas, boolean loadObjectTemplateTilesets); void update(float delta); void draw(Graphics g, int x, int y); void draw(Graphics g, int x, int y, int layer); void draw(Graphics g, int x, int y, int startTileX, int startTileY, int widthInTiles, int heightInTiles); void draw(Graphics g, int x, int y, int startTileX, int startTileY, int widthInTiles, int heightInTiles,
			int layer); void drawTileLayer(Graphics g, TileLayer layer, int renderX, int renderY, int startTileX, int startTileY,
			int widthInTiles, int heightInTiles); void drawGroupLayer(Graphics g, GroupLayer layer, int renderX, int renderY, int startTileX, int startTileY,
	                          int widthInTiles, int heightInTiles); boolean containsProperty(String propertyName); String getProperty(String propertyName); void setProperty(String propertyName, String value); TileLayer getTileLayer(String name); TileLayer getTileLayer(String name, boolean recursive); TileLayer getTileLayer(int index); GroupLayer getGroupLayer(String name); GroupLayer getGroupLayer(String name, boolean recursive); GroupLayer getGroupLayer(int index); TiledObjectGroup getObjectGroup(String name); TiledObjectGroup getObjectGroup(String name, boolean recursive); Iterable<TiledObjectGroup> getObjectGroups(); int getLayerIndex(String name); int getLayerIndexIgnoreCase(String name); Tile getTile(int tileId); Tile getTile(int x, int y, int layer); void dispose(); void dispose(boolean disposeTilesets); Orientation getOrientation(); StaggerAxis getStaggerAxis(); StaggerIndex getStaggerIndex(); int getSideLength(); int getWidth(); int getHeight(); int getTileWidth(); int getTileHeight(); int getPixelWidth(); int getPixelHeight(); Array<Tileset> getTilesets(); Array<Layer> getLayers(); int getTotalObjectGroups(); Color getBackgroundColor(); void setTileLayerRenderer(TileLayerRenderer tileLayerRenderer); void setTiledObjectGroupRenderer(TiledObjectGroupRenderer tiledObjectGroupRenderer); boolean containsAnimatedTiles(); }
TiledMap { public Iterable<TiledObjectGroup> getObjectGroups() { return tiledMapData.getObjectGroups(); } TiledMap(FileHandle fileHandle);  TiledMap(FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledParser parser, FileHandle fileHandle, boolean loadTilesetTextures);  TiledMap(TiledMapData tiledMapData, boolean loadTilesetTextures); boolean isTilesetTexturesLoaded(); boolean isTilesetTexturesLoaded(boolean ignoreObjectTemplateTilesets); boolean loadTilesetTextures(); boolean loadTilesetTextures(AssetManager assetManager); boolean loadTilesetTextures(TextureAtlas textureAtlas); boolean loadTilesetTextures(boolean loadObjectTemplateTilesets); boolean loadTilesetTextures(AssetManager assetManager, boolean loadObjectTemplateTilesets); boolean loadTilesetTextures(TextureAtlas textureAtlas, boolean loadObjectTemplateTilesets); void update(float delta); void draw(Graphics g, int x, int y); void draw(Graphics g, int x, int y, int layer); void draw(Graphics g, int x, int y, int startTileX, int startTileY, int widthInTiles, int heightInTiles); void draw(Graphics g, int x, int y, int startTileX, int startTileY, int widthInTiles, int heightInTiles,
			int layer); void drawTileLayer(Graphics g, TileLayer layer, int renderX, int renderY, int startTileX, int startTileY,
			int widthInTiles, int heightInTiles); void drawGroupLayer(Graphics g, GroupLayer layer, int renderX, int renderY, int startTileX, int startTileY,
	                          int widthInTiles, int heightInTiles); boolean containsProperty(String propertyName); String getProperty(String propertyName); void setProperty(String propertyName, String value); TileLayer getTileLayer(String name); TileLayer getTileLayer(String name, boolean recursive); TileLayer getTileLayer(int index); GroupLayer getGroupLayer(String name); GroupLayer getGroupLayer(String name, boolean recursive); GroupLayer getGroupLayer(int index); TiledObjectGroup getObjectGroup(String name); TiledObjectGroup getObjectGroup(String name, boolean recursive); Iterable<TiledObjectGroup> getObjectGroups(); int getLayerIndex(String name); int getLayerIndexIgnoreCase(String name); Tile getTile(int tileId); Tile getTile(int x, int y, int layer); void dispose(); void dispose(boolean disposeTilesets); Orientation getOrientation(); StaggerAxis getStaggerAxis(); StaggerIndex getStaggerIndex(); int getSideLength(); int getWidth(); int getHeight(); int getTileWidth(); int getTileHeight(); int getPixelWidth(); int getPixelHeight(); Array<Tileset> getTilesets(); Array<Layer> getLayers(); int getTotalObjectGroups(); Color getBackgroundColor(); void setTileLayerRenderer(TileLayerRenderer tileLayerRenderer); void setTiledObjectGroupRenderer(TiledObjectGroupRenderer tiledObjectGroupRenderer); boolean containsAnimatedTiles(); static boolean STRICT_LAYER_VISIBILITY; static boolean FAST_RENDER_EMPTY_LAYERS; static boolean CLIP_TILES_OUTSIDE_GRAPHICS_VIEWPORT; }