public class AndroidAssets extends Assets
| Modifier and Type | Class and Description |
|---|---|
static interface |
AndroidAssets.AssetSource
Configures from where our assets are loaded.
|
class |
AndroidAssets.BitmapOptions
Extends
BitmapFactory.Options with PlayN asset scale configuration. |
static interface |
AndroidAssets.BitmapOptionsAdjuster
|
| Constructor and Description |
|---|
AndroidAssets(AndroidPlatform plat) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getBytesSync(String path) |
Sound |
getMusic(String path) |
Image |
getRemoteImage(String url,
int width,
int height) |
Sound |
getSound(String path) |
String |
getTextSync(String path) |
android.graphics.Typeface |
getTypeface(String path)
Loads a typeface from
path. |
void |
setAssetScale(float scaleFactor)
Configures the default scale to use for assets.
|
void |
setAssetSource(AndroidAssets.AssetSource source)
Configures the place from which our assets are loaded.
|
void |
setBitmapOptionsAdjuster(AndroidAssets.BitmapOptionsAdjuster optionsAdjuster)
Configures a class that will adjust the
AndroidAssets.BitmapOptions used to decode loaded bitmaps. |
void |
setPathPrefix(String prefix)
Configures a prefix which is prepended to all asset paths prior to loading.
|
getBytes, getImage, getImageSync, getRemoteImage, getTextpublic AndroidAssets(AndroidPlatform plat)
public void setPathPrefix(String prefix)
assets directory. This prefix is thus inserted between assets and the path supplied
to any of the various get methods.public void setAssetScale(float scaleFactor)
public void setBitmapOptionsAdjuster(AndroidAssets.BitmapOptionsAdjuster optionsAdjuster)
AndroidAssets.BitmapOptions used to decode loaded bitmaps.
An app may wish to use different bitmap configs for different images (say RGB_565 for
its non-transparent images) or adjust the dithering settings.public void setAssetSource(AndroidAssets.AssetSource source)
AssetManager, but a custom source can be used to, for example, load assets from an
expansion APK.public android.graphics.Typeface getTypeface(String path)
path. This can then be registered via
AndroidGraphics.registerFont(android.graphics.Typeface, java.lang.String, playn.core.Font.Style, java.lang.String...).public Image getRemoteImage(String url, int width, int height)
getRemoteImage in class Assetspublic String getTextSync(String path) throws Exception
getTextSync in class AssetsExceptionpublic ByteBuffer getBytesSync(String path) throws Exception
getBytesSync in class AssetsExceptionCopyright © 2017. All Rights Reserved.