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.
14 lines
409 B
14 lines
409 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 y = Global.world.find_elevation(Vector2(x, z))
|
|
if y > 0:
|
|
pixel_color = Color("#0F0")
|
|
img.set_pixel(x, z, pixel_color)
|
|
|
|
texture = ImageTexture.create_from_image(img)
|
|
|