You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
472 B
16 lines
472 B
extends TextureRect
|
|
|
|
func _ready():
|
|
var img = Image.create(Global.world.width, Global.world.height, false, Image.FORMAT_RGBA8)
|
|
|
|
for x in Global.world.width:
|
|
for z in Global.world.height:
|
|
var pixel_color = Color("#00F")
|
|
var bloc = Global.world.get_bloc(Vector2i(x, z))
|
|
if bloc.type != 0:
|
|
pixel_color = Color("#0F0")
|
|
if bloc.entity != -1:
|
|
pixel_color = Color("F00")
|
|
img.set_pixel(x, z, pixel_color)
|
|
|
|
texture = ImageTexture.create_from_image(img)
|
|
|