Hallo,
I’m trying to do a rts-style minimap and in the process I stumbled over one issue I couldn’t solve:
I have some problems with the placing of the OnscreenImages. I guess the pos you specify for the OnscreenImage is given in aspect2d coordinates, right?
Now if I try to place an Image in the lower left corner by using the following coordinates, I still can’t see the whole image(only slightly displaced in both directions):
I don’t know what commands you are using to create your OnscreenImage, but if you are loading an image using the low-level PNMImage library, it is up to you to enable transparency on the resulting OnscreenImage object. You can do this with:
An easier way to locate an object in the lower-left corner is to parent it to base.a2dBottomLeft instead of the default, aspect2d. You can do this with:
myOnscreenImage.reparentTo(base.a2dBottomLeft)
or specify parent = base.a2dBottomLeft in the OnscreenImage constructor.
Thanks, drwr.
I solved number 1 already.
On number 2:
I’m trying to place the image in such a way that it’s lower left corner is in the lower left corner of the screen. By reparenting to the lower left corner I would still have to do calculations similar to my first post.
But those don’t seem to be right.