it only shows 1/4 of the image (the top left), i thought base.a2dBottomRight was suposed to place the botton right of the image with the botton right of the screen.
is there any way to scale the image when i change the resolution os the screen?
The problem is probably that your image is being parented correctly to the bottom corner of the screen, but the (0,0) point for the image is at the center of it. That would mean the center of the image is placed at the bottom right corner, causing you to only see 1/4 of it. Try moving the image up and left by half it’s size.
There is. You can use the following code to get the width and height of the default window, in pixels, at any time.
From there you just have set the scale of the mini map accordingly.
Since you’re parenting the image to base.aspect2d it should already be resizing to take up the same amount of the window when you change the window size, so I’m guessing you want to change that bevior? You might be better parenting it to render2d then.
Using pos that way would work, yes. The alternative would be setting things up so that the (0,0) point for your image is in the appropriate corner. OnScreenImage can take an egg, instead of an image file, so you could do this with egg-texture-cards. You would just set the left, right, bottom, and top with the -g and -p flags when using egg-texture-cards. For example, if your image was 512 x 512 and you wanted in to .1 screen units square, you would do
Then you would load that egg with loader.loadModel and supply it to the OnScreenImage. Or maybe you can give an egg filename to OnScreenImage, I don’t know.
The difference is that aspect2d compensates for the aspect ratio of a non-square window, and render2d doesn’t. So when parenting things to render2d, you need to scale them manually to adjust for the ratio of the window. Otherwise they may be distorted.