Solarus-Games English Forum

Community => Your scripts => Topic started by: Diarandor on January 08, 2017, 11:39:57 AM

Title: Animated sprites for dialogs (custom dialog script)
Post by: Diarandor on January 08, 2017, 11:39:57 AM
I was asked by @Porksteak to explain how to use the animation sprites of my custom dialog box:
https://github.com/Diarandor/repository/blob/master/data/scripts/dialog_box.lua
https://www.youtube.com/watch?v=CRRcZjAwMw8
My old script does not explain how to use this feature (I forgot to add these explanations). I post this here so anyone will know how to use it:

An example would be this dialog:
Code (Lua) Select

dialog{
  id = "old_man.thanks",
  animation = "talking",
  animation_sprite = "dialog_old_man",
  text = [[
Thanks for saving my
cats, young man.
See you later!
]]
}


The (optional) sprite of the character has to be located in the path given by the concatenated string:
"dialogs/" .. dialog.animation_sprite
and the animation used is the one given by the string: dialog.animation
Title: Re: Animated sprites for dialogs (custom dialog script)
Post by: MetalZelda on January 08, 2017, 02:59:06 PM
The faster way is to do it through the editor  :P

(http://i.imgur.com/Od016hx.png)
Title: Re: Animated sprites for dialogs (custom dialog script)
Post by: Diarandor on January 08, 2017, 06:33:18 PM
Yeah, I had forgotten about that. :o