Transition from old OnGUI() to Canvas.I need your help!

Hello! So i decided to change my old onGUI() method to canvas.

1)How can draw some textures like this in canvas by a script:

   for (int i = 0; i < ResourceManager.mapIconObjects.Count; i++)
        {
            float x, z;
            x = GetMapPos(ResourceManager.mapIconObjects*.transform.position.x, 200, 500);*

z = GetMapPos(ResourceManager.mapIconObjects*.transform.position.z, 200, 500);*
OreDeposit oreResource = ResourceManager.mapIconObjects*.GetComponent();*
if (oreResource)
{
x = x - resourceIconSize / 2;
z = ((z * -1) - resourceIconSize / 2) + 200;
GUI.Box(new Rect(x, z, resourceIconSize, resourceIconSize), “”, iconStyleResource);
}
}
I mean, how to draw them on screen like this:
[44334-canvas.jpg|44334]

You can have a reference to the canvas and instantiate new objects(make sure to set the canvas or other gameobject as their parents) with pre made images and size them to fit the required screen area or make a new gameobject and add the components and configure them.

There are many useful methods for the new UI system to assist with things you may want to achieve.

I suggest to check the Unity tutorials on the canvas to know how to use it, and maybe check some of the live training videos too. You can always ask here again if you need to!