use of com.ait.lienzo.client.core.image.ImageLoader in project lienzo-core by ahome-it.
the class Sprite method load.
Sprite load() {
if (isLoaded()) {
if (null != m_loaded) {
m_loaded.onSpriteLoaded(this);
}
} else {
final String url = getURL();
new ImageLoader(url) {
@Override
public void onImageElementLoad(final ImageElement elem) {
m_sprite = elem;
if (null != m_loaded) {
m_loaded.onSpriteLoaded(Sprite.this);
}
}
@Override
public void onImageElementError(final String message) {
LienzoCore.get().error("Sprite could not load URL " + url + " " + message);
}
};
}
return this;
}
Aggregations