Ajout de la 2D et du texte => couleurs pas finies + bug ordre affichage

This commit is contained in:
2026-08-30 16:59:35 +02:00
parent ab43ad1604
commit 82314d7d85
27 changed files with 412 additions and 119 deletions
+138 -10
View File
@@ -1,6 +1,5 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "SceneDescription",
"type": "object",
"properties": {
"name": { "type": "string", "ID": 101},
@@ -9,6 +8,11 @@
"type": "array",
"ID": 103,
"items": { "$ref": "#/definitions/Entity" }
},
"entities2D": {
"type": "array",
"ID": 104,
"items": { "$ref": "#/definitions/Entity2D" }
}
},
"required": ["name", "entities"],
@@ -31,6 +35,17 @@
"required": ["entityref", "name", "components"]
},
"Entity2D": {
"type": "object",
"properties": {
"entityref": { "type": "integer", "ID": 207 },
"name": { "type": "string", "ID": 208 },
"description": { "type": "string", "ID": 209},
"components": { "ID": 210, "$ref": "#/definitions/Components2D" }
},
"required": ["entityref", "name", "components"]
},
"Components": {
"type": "object",
"properties": {
@@ -38,10 +53,30 @@
"renderer": { "ID": 2062, "$ref": "#/definitions/Renderer" },
"camera": { "ID": 2063, "$ref": "#/definitions/Camera" },
"collider": { "ID": 2064, "$ref": "#/definitions/Collider" },
"rigidbody": { "ID": 2065, "$ref": "#/definitions/RigidBody" }
"rigidbody": { "ID": 2065, "$ref": "#/definitions/RigidBody" },
"speaker": { "ID": 2066, "$ref": "#/definitions/Speaker" },
"script": { "ID": 2067, "$ref": "#/definitions/Script" },
"light": { "ID": 2068, "$ref": "#/definitions/Light" }
}
},
"Components2D": {
"type": "object",
"properties": {
"transform": { "ID": 2069, "$ref": "#/definitions/Transform2D" },
"renderer": { "ID": 2070, "$ref": "#/definitions/Renderer2D" },
"camera": { "ID": 2071, "$ref": "#/definitions/Camera2D" },
"collider": { "ID": 2072, "$ref": "#/definitions/Collider2D" }
}
},
"Vec2": {
"type": "array",
"items": { "type": "number" },
"minItems": 2,
"maxItems": 2
},
"Vec3": {
"type": "array",
"items": { "type": "number" },
@@ -66,6 +101,20 @@
"required": ["position", "rotation", "scale"]
},
"Transform2D": {
"type": "object",
"properties": {
"position": { "ID": 4011, "$ref": "#/definitions/Vec2" },
"rotation": { "ID": 4012, "type": "number" },
"scale": { "ID": 4013, "$ref": "#/definitions/Vec2" },
"size": { "ID": 4014, "$ref": "#/definitions/Vec2" },
"pivot": { "ID": 4015, "$ref": "#/definitions/Vec3" },
"zorder": { "ID": 4016, "type": "integer", "minimum": 0 },
"visible": { "ID": 4017, "type": "boolean" }
},
"required": ["position", "size"]
},
"Renderer": {
"type": ["object", "null"],
"properties": {
@@ -76,6 +125,15 @@
"required": ["model", "shader"]
},
"Renderer2D": {
"type": ["object", "null"],
"properties": {
"model": { "type": "string", "ID": 4021 },
"shader": { "type": "string", "ID": 4022 }
},
"required": ["model", "shader"]
},
"Camera": {
"type": ["object", "null"],
"properties": {
@@ -86,13 +144,21 @@
"required": ["fov", "near", "far"]
},
"Camera2D": {
"type": ["object", "null"],
"properties": {
"zoom": { "type": "number", "minimum": 1.0, "ID": 4031 }
},
"required": ["zoom"]
},
"Collider": {
"type": ["object", "null"],
"properties": {
"type": {
"type": "string",
"type": "integer",
"ID": 3041,
"enum": ["Box", "Sphere", "Capsule", "ConvexHull", "Mesh", "Compound"]
"enum": [0,1,2,3,4,5]
},
"size": { "$ref": "#/definitions/Vec3", "ID": 3042 },
"radius": { "type": "number", "minimum": 0, "ID": 3043 },
@@ -101,33 +167,95 @@
"required": ["type"],
"allOf": [
{
"if": { "properties": { "type": { "const": "Box" } } },
"if": { "properties": { "type": { "const": 0 } } },
"then": { "required": ["size"] }
},
{
"if": { "properties": { "type": { "const": "Sphere" } } },
"if": { "properties": { "type": { "const": 1 } } },
"then": { "required": ["radius"] }
},
{
"if": { "properties": { "type": { "const": "Capsule" } } },
"if": { "properties": { "type": { "const": 2 } } },
"then": { "required": ["radius", "halfHeight"] }
}
]
},
"Collider2D": {
"type": ["object", "null"],
"properties": {
"type": {
"type": "integer",
"ID": 4041,
"enum": [0,1,2,3]
}
},
"required": ["type"]
},
"RigidBody": {
"type": ["object", "null"],
"properties": {
"type": {
"type": "string",
"type": "integer",
"ID": 3051,
"enum": ["Static", "Kinematic", "Dynamic"]
"enum": [0,1,2]
},
"mass": { "type": "number", "minimum": 0, "ID": 3052 },
"friction": { "type": "number", "minimum": 0, "maximum": 1, "ID": 3053 },
"restitution": { "type": "number", "minimum": 0, "maximum": 1, "ID": 3054 }
},
"required": ["type"]
},
"Speaker": {
"type": ["object", "null"],
"properties": {
"clips": {
"type": "array",
"ID": 3061,
"items": {
"type": "object",
"properties": {
"path": { "type": "string", "ID": 30611 },
"gain": { "type": "number", "minimum": 0, "ID": 30612 },
"pitch": { "type": "number", "minimum": 0, "ID": 30613 },
"loop": { "type": "boolean", "ID": 30614 },
"spatial": { "type": "boolean", "ID": 30615 }
},
"required": ["path"]
}}
},
"required": ["clips"]
},
"Light": {
"type": ["object", "null"],
"properties": {
"type": {
"type": "integer",
"ID": 3071,
"enum": [0,1,2]
},
"color": { "$ref": "#/definitions/Vec3", "ID": 3072 },
"intensity": { "type": "number", "minimum": 0, "ID": 3073 },
"range": { "type": "number", "minimum": 0, "ID": 3074 },
"attenuation": { "type": "number", "minimum": 0, "ID": 3075 },
"innerangle": { "type": "number", "minimum": 0, "ID": 3076 },
"outerangle": { "type": "number", "minimum": 0, "ID": 3077 },
"castshadow": { "type": "boolean", "ID": 3078 }
},
"required": ["type", "color", "intensity", "range", "attenuation", "innerangle", "outerangle", "castshadow"]
},
"Script": {
"type": ["object", "null"],
"properties": {
"scriptNames": {
"type": "array",
"items": {"type" : "string", "ID": 3079}}
},
"required": ["scriptNames"]
}
}
}
}