Skip to content

Commit

Permalink
[libgdx] Convenience method to add all attachment from one skin to an…
Browse files Browse the repository at this point in the history
…other.
  • Loading branch information
NathanSweet committed Jul 31, 2017
1 parent 4139546 commit a0b7bb6
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -64,6 +64,12 @@ public void addAttachment (int slotIndex, String name, Attachment attachment) {
attachments.put(key, attachment);
}

/** Adds all attachments from the specified skin to this skin. */
public void addAttachments (Skin skin) {
for (Entry<Key, Attachment> entry : skin.attachments.entries())
addAttachment(entry.key.slotIndex, entry.key.name, entry.value);
}

/** Returns the attachment for the specified slot index and name, or null. */
public Attachment getAttachment (int slotIndex, String name) {
if (slotIndex < 0) throw new IllegalArgumentException("slotIndex must be >= 0.");
Expand Down

0 comments on commit a0b7bb6

Please sign in to comment.