Open bhavikshah1995 opened 5 years ago
@bhavikshah1995 Here is my answer to a similar issue ( #564 ). Does that help you?
funny thing. I'm struggling with the same issue at the moment
@bestog I must say that I have problems with connecting your issue with this one. With the 3D object that is converted the case is pretty easy. But here we have a simple view that needs to be connected with a node
@bhavikshah1995 did you managed to solve the problem?
@dpacholczyk maybe, but my comment in the other issue can solve this issue with another approach. Both issues have in the end the same goal. :)
@dpacholczyk @bestog yes, here is my code for the same:
ImageView imageView = new ImageView(context);
Picasso.get()
.load(R.drawable.resume)
.memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)
.into(imageView);
rendobject =
ViewRenderable.builder()
.setView(context, imageView)
.setVerticalAlignment(ViewRenderable.VerticalAlignment.BOTTOM)
.setSizer(new FixedHeightViewSizer(0.04f))
.build()
.thenAccept(renderable -> {
getTestViewRenderable2 = renderable;
Vector3 localPosition = new Vector3();
Node cornerNode2;
localPosition.set(+0.4f * image.getExtentX(), 0.01f, +0.2f * image.getExtentZ());
cornerNode2 = new Node();
cornerNode2.setParent(this);
cornerNode2.setLocalPosition(localPosition);
cornerNode2.setLocalRotation(Quaternion.axisAngle(new Vector3(-1f, 0, 0), 90f));
cornerNode2.setRenderable(getTestViewRenderable2);
});
You can load from a URL as well within Picasso
@bhavikshah1995 could you share the whole class? I would like to understand better what is "image" and where are you putting those specific parts. I have problems with running a similar example. I hope it's not a problem.
nvm I solved the problem :)
I am struggling with displaying an image fetched from a URL in an ImageView within a ViewRenderable. Here is my code.
Any help is much appreciated :)
if (rendobject == null) {
}