Refine search
/** Get multiple attributes at once. Example: material.get(out, ColorAttribute.Diffuse | ColorAttribute.Specular | * TextureAttribute.Diffuse); */ public final Array<Attribute> get (final Array<Attribute> out, final long type) { for (int i = 0; i < attributes.size; i++) if ((attributes.get(i).type & type) != 0) out.add(attributes.get(i)); return out; }
/** Get multiple attributes at once. Example: material.get(out, ColorAttribute.Diffuse | ColorAttribute.Specular | * TextureAttribute.Diffuse); */ public final Array<Attribute> get (final Array<Attribute> out, final long type) { for (int i = 0; i < attributes.size; i++) if ((attributes.get(i).type & type) != 0) out.add(attributes.get(i)); return out; }
/** @param name the name of the children * @return the children with the given name or an empty {@link Array} */ public Array<Element> getChildrenByName (String name) { Array<Element> result = new Array<Element>(); if (children == null) return result; for (int i = 0; i < children.size; i++) { Element child = children.get(i); if (child.name.equals(name)) result.add(child); } return result; }
/** @param name the name of the children * @return the children with the given name or an empty {@link Array} */ public Array<Element> getChildrenByName (String name) { Array<Element> result = new Array<Element>(); if (children == null) return result; for (int i = 0; i < children.size; i++) { Element child = children.get(i); if (child.name.equals(name)) result.add(child); } return result; }
public boolean executeRunnables () { synchronized (runnables) { for (int i = runnables.size - 1; i >= 0; i--) executedRunnables.add(runnables.get(i)); runnables.clear(); } if (executedRunnables.size == 0) return false; for (int i = executedRunnables.size - 1; i >= 0; i--) executedRunnables.removeIndex(i).run(); return true; }
/** Returns all regions with the specified name, ordered by smallest to largest {@link AtlasRegion#index index}. This method * uses string comparison to find the regions, so the result should be cached rather than calling this method multiple times. */ public Array<AtlasRegion> findRegions (String name) { Array<AtlasRegion> matched = new Array(AtlasRegion.class); for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (region.name.equals(name)) matched.add(new AtlasRegion(region)); } return matched; }
public boolean executeRunnables () { synchronized (runnables) { for (int i = runnables.size - 1; i >= 0; i--) executedRunnables.add(runnables.get(i)); runnables.clear(); } if (executedRunnables.size == 0) return false; do executedRunnables.pop().run(); while (executedRunnables.size > 0); return true; }
public boolean executeRunnables () { synchronized (runnables) { for (int i = runnables.size - 1; i >= 0; i--) executedRunnables.add(runnables.get(i)); runnables.clear(); } if (executedRunnables.size == 0) return false; do executedRunnables.pop().run(); while (executedRunnables.size > 0); return true; }
/** 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; }
public boolean executeRunnables () { synchronized (runnables) { for (int i = runnables.size - 1; i >= 0; i--) executedRunnables.add(runnables.get(i)); runnables.clear(); } if (executedRunnables.size == 0) return false; for (int i = executedRunnables.size - 1; i >= 0; i--) executedRunnables.removeIndex(i).run(); return true; }
/** Returns all regions with the specified name, ordered by smallest to largest {@link AtlasRegion#index index}. This method * uses string comparison to find the regions, so the result should be cached rather than calling this method multiple times. */ public Array<AtlasRegion> findRegions (String name) { Array<AtlasRegion> matched = new Array(AtlasRegion.class); for (int i = 0, n = regions.size; i < n; i++) { AtlasRegion region = regions.get(i); if (region.name.equals(name)) matched.add(new AtlasRegion(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; }