A dialogue chat block display component for php project. A UI component for conversational novel community. Date: 30 Aug, 2021 Author: Tang Hoong
Just dump the string format which exactly same as sample.txt then ChatBlock will render them into perfect and nice chat blocks.
Follow the format from sample.txt:
Snake: https://i.imgur.com/FEiFVeO.png
---
Narator: Once upon a time...
Snake: Wanna eat apple θΉζ πππ?
then
include 'ChatBlock.php';
$lines = file_get_contents('./chapter.1.txt');
$cb = new ChatBlock($lines);
echo $cb->read();
become