feat: switch hotspot coordinates from container percentage to absolute content pixels

This commit is contained in:
2026-06-10 12:45:41 +08:00
parent 5eac0f23a8
commit bb289f5438
4 changed files with 75 additions and 15 deletions

View File

@@ -112,6 +112,7 @@
"type": "image",
"videoUrl": "",
"imageUrl": "investigation_site/investigation_scene.jpg",
"contentSize": { "w": 1280, "h": 720 },
"subtitleUrl": "investigation_site/investigation.vtt",
"subtitles": {
"zh": "investigation_site/investigation.vtt",
@@ -123,7 +124,7 @@
"id": "hs_desk",
"label": "查看书桌",
"targetScene": "desk_detail",
"x": 0.12, "y": 0.20, "width": 0.18, "height": 0.14,
"x": 154, "y": 144, "width": 230, "height": 101,
"effects": [
{ "type": "add", "target": "investigation", "value": 1 },
{ "type": "toggleFlag", "target": "checked_desk" }
@@ -133,13 +134,13 @@
"id": "hs_window",
"label": "查看窗户",
"targetScene": "corridor",
"x": 0.47, "y": 0.06, "width": 0.15, "height": 0.28
"x": 602, "y": 43, "width": 192, "height": 202
},
{
"id": "hs_closet",
"label": "检查衣柜",
"targetScene": "desk_detail",
"x": 0.33, "y": 0.48, "width": 0.10, "height": 0.26,
"x": 422, "y": 346, "width": 128, "height": 187,
"conditions": [
{ "variable": "investigation", "op": ">=", "value": 1 }
],
@@ -154,12 +155,13 @@
"corridor": {
"id": "corridor",
"videoUrl": "corridor/corridor.mp4",
"contentSize": { "w": 1280, "h": 720 },
"hotspots": [
{
"id": "hs_left",
"label": "走向左边通道",
"targetScene": "left_door",
"x": 0.02, "y": 0.30, "width": 0.30, "height": 0.45,
"x": 26, "y": 216, "width": 384, "height": 324,
"showAt": 1.5,
"effects": [
{ "type": "add", "target": "courage", "value": 5 }
@@ -169,14 +171,14 @@
"id": "hs_center",
"label": "走向中间通道",
"targetScene": "trust_ending",
"x": 0.33, "y": 0.25, "width": 0.34, "height": 0.55,
"x": 422, "y": 180, "width": 435, "height": 396,
"showAt": 3.0
},
{
"id": "hs_right",
"label": "走向右边通道",
"targetScene": "alone_ending",
"x": 0.68, "y": 0.30, "width": 0.30, "height": 0.45,
"x": 870, "y": 216, "width": 384, "height": 324,
"showAt": 5.0
}
]