/** Returns the first region found with the specified name as a sprite. If whitespace was stripped from the region when it was * packed, the sprite is automatically positioned as if whitespace had not been stripped. This method uses string comparison to * find the region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. */ public Sprite createSprite (String name) { for (int i = 0, n = regions.size; i < n; i++) if (regions.get(i).name.equals(name)) return newSprite(regions.get(i)); return null; }
/** Returns the first region found with the specified name as a sprite. If whitespace was stripped from the region when it was * packed, the sprite is automatically positioned as if whitespace had not been stripped. This method uses string comparison to * find the region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. */ public Sprite createSprite (String name) { for (int i = 0, n = regions.size; i < n; i++) if (regions.get(i).name.equals(name)) return newSprite(regions.get(i)); return null; }
/** Returns the first region found with the specified name and index as a sprite. This method uses string comparison to find the * region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. * @see #createSprite(String) */ public Sprite createSprite (String name, int index) { for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (!region.name.equals(name)) continue; if (region.index != index) continue; return newSprite(regions.get(i)); } return null; }
/** Returns the first region found with the specified name and index as a sprite. This method uses string comparison to find the * region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. * @see #createSprite(String) */ public Sprite createSprite (String name, int index) { for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (!region.name.equals(name)) continue; if (region.index != index) continue; return newSprite(regions.get(i)); } return null; }
/** Returns all regions with the specified name as sprites, ordered by smallest to largest {@link AtlasRegion#index index}. This * method uses string comparison to find the regions and constructs new sprites, so the result should be cached rather than * calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites (String name) { Array<Sprite> matched = new Array(Sprite.class); for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (region.name.equals(name)) matched.add(newSprite(region)); } return matched; }
/** Returns all regions with the specified name as sprites, ordered by smallest to largest {@link AtlasRegion#index index}. This * method uses string comparison to find the regions and constructs new sprites, so the result should be cached rather than * calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites (String name) { Array<Sprite> matched = new Array(Sprite.class); for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (region.name.equals(name)) matched.add(newSprite(region)); } return matched; }
/** Returns all regions in the atlas as sprites. This method creates a new sprite for each region, so the result should be * stored rather than calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites () { Array sprites = new Array(true, regions.size, Sprite.class); for (int i = 0, n = regions.size; i < n; i++) sprites.add(newSprite(regions.get(i))); return sprites; }
/** Returns all regions in the atlas as sprites. This method creates a new sprite for each region, so the result should be * stored rather than calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites () { Array sprites = new Array(true, regions.size, Sprite.class); for (int i = 0, n = regions.size; i < n; i++) sprites.add(newSprite(regions.get(i))); return sprites; }
/** Returns the first region found with the specified name as a sprite. If whitespace was stripped from the region when it was * packed, the sprite is automatically positioned as if whitespace had not been stripped. This method uses string comparison to * find the region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. */ public Sprite createSprite (String name) { for (int i = 0, n = regions.size; i < n; i++) if (regions.get(i).name.equals(name)) return newSprite(regions.get(i)); return null; }
/** Returns the first region found with the specified name and index as a sprite. This method uses string comparison to find the * region and constructs a new sprite, so the result should be cached rather than calling this method multiple times. * @return The sprite, or null. * @see #createSprite(String) */ public Sprite createSprite (String name, int index) { for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (!region.name.equals(name)) continue; if (region.index != index) continue; return newSprite(regions.get(i)); } return null; }
/** Returns all regions with the specified name as sprites, ordered by smallest to largest {@link AtlasRegion#index index}. This * method uses string comparison to find the regions and constructs new sprites, so the result should be cached rather than * calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites (String name) { Array<Sprite> matched = new Array(Sprite.class); for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (region.name.equals(name)) matched.add(newSprite(region)); } return matched; }
/** Returns all regions in the atlas as sprites. This method creates a new sprite for each region, so the result should be * stored rather than calling this method multiple times. * @see #createSprite(String) */ public Array<Sprite> createSprites () { Array sprites = new Array(true, regions.size, Sprite.class); for (int i = 0, n = regions.size; i < n; i++) sprites.add(newSprite(regions.get(i))); return sprites; }