|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.utils.HUDTextureUtils
public class HUDTextureUtils
HUDTextureUtils is a utility class that provides class methods to load and cache textures for your game.
Before you call one of the methods here, you need to have created a ResourceLocator with a folder as the base resource folder, which
will be used as the relative location for further resources. You will make this new ResourceLocator globally accessible (which you will
need later.) Then you need to create a TextureStreamLocator for each folder containing textures to be used.
Example:
ResourceLocator resLoc = ResourceLocator.create("resources/");
resLoc.useAsSingletonInstance();
resLoc.createAndAddTSL("textures");
ResourceLocator,
TextureStreamLocator| Constructor Summary | |
|---|---|
HUDTextureUtils()
|
|
| Method Summary | |
|---|---|
static Texture2D |
getTexture(java.lang.String textureName)
The HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. |
static Texture2D |
getTexture(java.lang.String textureName,
boolean useCache)
The HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. |
static int |
getTextureHeight(Texture2D texture)
Returns the height (in pixels) of the specified texture. |
static int |
getTextureHeight(TextureImage2D texture,
boolean isDrawTexture)
Returns the height (in pixels) of the specified texture image. |
static Texture2D |
getTextureOrNull(java.lang.String textureName)
The HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. |
static Texture2D |
getTextureOrNull(java.lang.String textureName,
boolean useCache)
The HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. |
static int |
getTextureWidth(Texture2D texture)
Returns the width (in pixels) of the specified texture. |
static int |
getTextureWidth(TextureImage2D texture,
boolean isDrawTexture)
Returns the width (in pixels) of the specified texture image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HUDTextureUtils()
| Method Detail |
|---|
public static final int getTextureWidth(TextureImage2D texture,
boolean isDrawTexture)
texture - org.xith3d.scenegraph.TextureImage2D - the texture image from which to get the width.isDrawTexture - boolean - a flag to indicate whether to draw the texture.
public static final int getTextureHeight(TextureImage2D texture,
boolean isDrawTexture)
texture - org.xith3d.scenegraph.TextureImage2D - the texture image from which to get the height.isDrawTexture - boolean - a flag to indicate whether to draw the texture.
public static final int getTextureWidth(Texture2D texture)
texture - org.xith3d.scenegraph.Texture2D - the texture from which to get the width.
public static final int getTextureHeight(Texture2D texture)
texture - org.xith3d.scenegraph.Texture2D - the texture from which to get the height.
public static final Texture2D getTexture(java.lang.String textureName,
boolean useCache)
HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. Returns the Texture2D instance specified by the
specified texture resource name.
textureName - java.lang.String - the resource name, that is searched in all the TextureStreamLocators, added to the
TextureLoader.useCache - boolean - a flag to indicate whether to retrieve the texture from the cache, if not the first time this texture is retrieved.
public static final Texture2D getTexture(java.lang.String textureName)
HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. Returns the Texture2D instance specified by the
specified texture resource name.
textureName - java.lang.String - the resource name, that is searched in all the TextureStreamLocators, added to the
TextureLoader.
public static final Texture2D getTextureOrNull(java.lang.String textureName,
boolean useCache)
HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. Returns the Texture2D instance specified by the
specified texture resource name.
textureName - java.lang.String - the resource name, that is searched in all the TextureStreamLocators, added to the
TextureLoader.useCache - boolean - a flag to indicate whether to retrieve the texture from the cache, if not the first time this texture is retrieved.
null is returned.public static final Texture2D getTextureOrNull(java.lang.String textureName)
HUDTextureUtils.getTexture() method is simply a wrapper for the
org.xith3d.loaders.texture.TextureLoader.getTexture() method. Returns the Texture2D instance specified by the
specified texture resource name.
textureName - java.lang.String - the resource name, that is searched in all the TextureStreamLocators, added to the
TextureLoader.
null is returned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||