Search in sources :

Example 1 with AutoClientBundleWithLookup

use of playn.core.AutoClientBundleWithLookup in project playn by threerings.

the class HtmlAssets method getSound.

@Override
public Sound getSound(String path) {
    String url = pathPrefix + path;
    AutoClientBundleWithLookup clientBundle = getBundle(path);
    if (clientBundle != null) {
        String key = getKey(path);
        DataResource resource = (DataResource) getResource(key, clientBundle);
        if (resource != null) {
            url = resource.getSafeUri().asString();
        }
    } else {
        url += ".mp3";
    }
    return adaptSound(url);
}
Also used : DataResource(com.google.gwt.resources.client.DataResource) AutoClientBundleWithLookup(playn.core.AutoClientBundleWithLookup)

Example 2 with AutoClientBundleWithLookup

use of playn.core.AutoClientBundleWithLookup in project playn by threerings.

the class HtmlAssets method getImage.

protected HtmlImage getImage(String path, Scale scale) {
    String url = pathPrefix + path;
    AutoClientBundleWithLookup clientBundle = getBundle(path);
    if (clientBundle != null) {
        String key = getKey(path);
        ImageResource resource = (ImageResource) getResource(key, clientBundle);
        if (resource != null) {
            url = resource.getSafeUri().asString();
        }
    }
    return adaptImage(url, scale);
}
Also used : ImageResource(com.google.gwt.resources.client.ImageResource) AutoClientBundleWithLookup(playn.core.AutoClientBundleWithLookup)

Aggregations

AutoClientBundleWithLookup (playn.core.AutoClientBundleWithLookup)2 DataResource (com.google.gwt.resources.client.DataResource)1 ImageResource (com.google.gwt.resources.client.ImageResource)1