Hi,
I try to just display texture on the screen, for ex: to display texture “abc.png” at position 3.3, 2.2 on the screen.
I previously used Button, but this time i want to just display the image, i do not need the interaction.
I looked into PGItem, but it doesn’t seem to accept textures. I appreciate a lot any hints!
Also is there any way to use the alpha of the png… i want to have 2 images one over the other, and see both using the transparency.
Thank you!
Best regards,
rdb
2
You can pass texture files to wfx.load_model, a quad will be returned that can be reparented to render2d.
You can enable the alpha of the texture by specifying set_transparency(1) on the NodePath.
I’m a bit confused, is this c++?
At this point i do the following:
PT(Texture) tex;
tex = TexturePool::load_texture(“img.png”);
CardMaker cm(“cardMaker”);
PT(PandaNode) readyCard = cm.generate();
NodePath path(readyCard);
path.set_texture( tex );
how should i do the re-parenting?
Thank you!
rdb
4
Your approach works as well. You just need to call path.reparent_to(window->get_aspect2d()) or so.
appwizz
5
Thank you.
That works well.