ajouts d'objectifs sur la carte, déplacements des icônes et divers changements

This commit is contained in:
2025-09-13 12:48:52 +02:00
parent e56ec31069
commit 85cd832864
81 changed files with 983 additions and 307 deletions

View File

@@ -1,13 +1,15 @@
class_name ImageTools
static func get_color_coverage(image: Image, color: Color = Color.WHITE):
static func get_color_coverage(image: Image, color: Color = Color.WHITE) -> float:
return float(get_color_pixel_count(image, color))/(image.get_width()*image.get_height())
static func get_color_pixel_count(image: Image, color: Color = Color.WHITE) -> int:
var pixel_color_count = 0.
for x in range(image.get_width()):
for y in range(image.get_height()):
if image.get_pixel(x, y) == color:
pixel_color_count += 1.
return pixel_color_count/(image.get_width()*image.get_height())
return pixel_color_count
static func draw_circle(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE):
for x in range(image.get_width()):