diff options
Diffstat (limited to 'src/net/java/joglutils/msg/elements/TextureElement.java')
-rw-r--r-- | src/net/java/joglutils/msg/elements/TextureElement.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/java/joglutils/msg/elements/TextureElement.java b/src/net/java/joglutils/msg/elements/TextureElement.java index 90a9ebc..199a113 100644 --- a/src/net/java/joglutils/msg/elements/TextureElement.java +++ b/src/net/java/joglutils/msg/elements/TextureElement.java @@ -57,13 +57,21 @@ public class TextureElement extends Element { public Element newInstance() { return new TextureElement(); } + /** Returns the instance of this element in the passed State. */ public static TextureElement getInstance(State state) { return (TextureElement) state.getElement(index); } + /** Enables this element in the passed state, which should be the + default for a given action. */ public static void enable(State defaultState) { TextureElement tmp = new TextureElement(); defaultState.setElement(tmp.getStateIndex(), tmp); } + /** Indicates whether this element is enabled in the given default + state for a particular action. */ + public static boolean isEnabled(State state) { + return (state.getDefaults().getElement(index) != null); + } // The actual Texture object protected Texture texture; |