--
---
You received this message because you are subscribed to a topic in the Google Groups "PlayN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/playn/_NLF3Rxj9-s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Second. I need to setup some custom HTTP headers and getRemoteImage won't let me do this. Is there any way to create an Image object out of a byte array? Then I could retrieve the raw bytes using Net.Builder (which lets me play with the request headers) and create the image once the data is ready.
--
---
You received this message because you are subscribed to the Google Groups "PlayN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
game.net.req("https://www.samskivert.com/images/2012/12/spellwood-app-icon.png").execute().
onSuccess(new Slot<Net.Response>() {
public void onEmit (Net.Response rsp) {
try {
Image icon = rsp.payloadImage(new Scale(2));
ImageLayer l4 = new ImageLayer(icon);
game.rootLayer.addAt(l4.setRotation(FloatMath.PI/4), 150, 150);
l4.events().connect(new Mover(l4).listener(game.input));
} catch (Exception e) {
game.log.warn("Failed to decode image: " + e);
}
}
}).
onFailure(new Slot<Throwable>() {
public void onEmit (Throwable t) {
game.log.warn("Failed to load image: " + t);
}
});
game.net.req("https://www.samskivert.com/images/2012/12/spellwood-app-icon.png").execute().
onSuccess(rsp -> {
try {
Image icon = rsp.payloadImage(new Scale(2));
ImageLayer l4 = new ImageLayer(icon);
game.rootLayer.addAt(l4.setRotation(FloatMath.PI/4), 150, 150);
l4.events().connect(new Mover(l4).listener(game.input));
} catch (Exception e) {
game.log.warn("Failed to decode image: " + e);
}
}).
onFailure(t -> game.log.warn("Failed to load image: " + t));
media.onReady.onSuccess(media -> {
// lay out our header view and wire it up
GoldenAge game = GoldenAge.this;
IDimension vs = game.plat.graphics().viewSize;
// ...
});