ID:1299854
 
(See the best response by Kaiochao.)
Code:
var
minimap
Minimap
const
MINIMAP_SIZE = 128

client
New()
..()
spawn(20)
screen += Minimap

world
New()
..()
spawn(5)
Minimap = new /minimap

minimap
parent_type = /obj
screen_loc = "minimap:1,1"

New()
..()
generateBackground()

proc
generateBackground()
var/obj/newObj = new
for(var/turf/Turf in world)
if(Turf.name != "turf")
var/icon/newIcon = icon(Turf.icon)
newObj.icon = newIcon.Scale(MINIMAP_SIZE / world.maxx, MINIMAP_SIZE / world.maxx)
newObj.pixel_x = (Turf.x - 1) * (MINIMAP_SIZE / world.maxx)
newObj.pixel_y = (Turf.y - 1) * (MINIMAP_SIZE / world.maxy)
underlays += newObj


Problem description:

I'm attempting to create a minimap that has a static background image, which is created when the game starts, of all of the turfs in the world. But nothing shows up and I have no idea what I'm doing wrong.
Best response
icon.Scale() doesn't return anything.