CS222-UIUC / VNEditor

web-driven visual novel editor
2 stars 1 forks source link

add get_frame router #38

Closed TwinIsland closed 1 year ago

TwinIsland commented 1 year ago
  1. Finish the get frame router, now you can get frame content by using task_id and fid
  2. add chapter and description feature in frame, add router to render the game content structure

Usgae: get_frame

method: post request: http://127.0.0.1:8000/engine/get_frame?task_id=vIokXpLtEwCl9i3SiXfxbQ&fid=22 response:

{
  "status": 1,
  "msg": "ok",
  "content": {
    "background": "b.jpg",
    "chara": [
      "c.jpg",
      "c.jpg"
    ],
    "chara_pos": [
      [
        12,
        11.9
      ],
      [
        56,
        11.9
      ]
    ],
    "music": "",
    "dialog": "hello world",
    "dialog_character": ""
  }
}

Usgae:

method: post request: http://127.0.0.1:8000/engine/get_struct?task_id=PM8lpabSIF81QlYVM403iQ response:

{
  "status": 1,
  "msg": "ok",
  "content": {
    "chapter1": [
      [
        20,
        "this is description for frame with id 20"
      ],
      [
        31,
        "frame 31 description"
      ],
      [
        33,
        "frame 33 description"
      ]
    ]
  }
}

comment below if having any questions and report bugs

Tesseract22 commented 1 year ago

Approved