I don't see your code, so will come up with mine. I take 12.TerrainRendering and add next two lines after env.DrawAll() call:
Code: Select all
driver.Draw2DPolygon(new Vector2Di(120, 120), 120, Color.OpaqueBlack, 4);
driver.DrawPixel(120, 120, Color.OpaqueRed);
This will make next image:
We see it over Irrlicht logo, because logo was added to GUI environment and been drawn when we call env.DrawAll(), so if we call our two lines of code before this call, we will see it at the bottom of the image. smgr.DrawAll() draws all the 3d, in this particular example if you draw anything before it, you will not see it on the screen, since "3d" (which are terrain and skybox) covers all the screen.
If you need to move image which you added to GUI environment, you can pass necessary arg to AddImage() or save returned value of it.
In this particular example, it is:
Code: Select all
// add irrlicht logo
env.AddImage(driver.GetTexture("../../media/irrlichtlogoalpha2.tga"), new Vector2Di(10));
We can rewrite code next way:
Code: Select all
// add irrlicht logo
Texture irrLogoTexture = driver.GetTexture("../../media/irrlichtlogoalpha2.tga");
GUIImage irrLogoGuiImage = env.AddImage(irrLogoTexture, new Vector2Di(10));
irrLogoGuiImage.RelativePosition = new Recti(new Vector2Di(100, 10), irrLogoTexture.Size);
If you need to draw black rectangle, then image, and then a red pixel, you will have to draw texture manually. Do not add it to GUI environment. Code of drawing this will be:
Code: Select all
driver.Draw2DPolygon(new Vector2Di(120, 120), 120, Color.OpaqueBlack, 4);
driver.Draw2DImage(irrLogoTexture, new Vector2Di(10), new Recti(new Vector2Di(0), irrLogoTexture.Size), null, Color.OpaqueWhite, true);
driver.DrawPixel(120, 120, Color.OpaqueRed);