Cinematic-UI
January 1, 2020 ยท View on GitHub
An easy-to-use UI to create simple cinematic conversations with NPCs on Onset
Demo:
Import package:
local CUI = ImportPackage("cinematicui")
Functions:
CUI.startCinematic(params, npc*, animation*)
{
title = "NPC Name",
message = "Hello world!"
actions = {
{
text = "Yes",
callback = "YesClickedOnCUI",
close_on_click = true
},
{
text = "No"
callback = "NoClickedOnCUI"
}
}
}
Please note that, in this example, YesClickedOnCUI and NoClickedOnCUI are events registered in your package like this:
AddEvent("YesClickedOnCUI", function()
-- Do something
end)
The Npc identifier (by default, it will be the closest NPC)
An animation present in the AnimationList. Default is WAVE2
CUI.updateCinematic(params, npc*, animation*)
Same as CUI.startCinematic.
Please note that iftitle and/or message is/are empty, the UI will keep those sent tostartCinematic. Not sending any actions will remove buttons from the UI.
CUI.stopCinematic(params, npc*, animation*)
Stops the cinematic.
