longtext.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package widget
  2. // import "gitlab.com/beoran/ebsgo/zori/event"
  3. // import . "gitlab.com/beoran/ebsgo/zori/types"
  4. // import _ "gitlab.com/beoran/ebsgo/zori/backend"
  5. // import "gitlab.com/beoran/ebsgo/zori/state"
  6. // import "gitlab.com/beoran/ebsgo/zori/style"
  7. /* A descriptor for the current state of the longtext */
  8. type LongtextState struct {
  9. /* Time waited between display of characters */
  10. wait float64
  11. /* Virtual text page we are currently on. */
  12. page int
  13. /* Line of text we are currently on. */
  14. line int
  15. /* Currently paused or not. */
  16. paused bool
  17. /* Total amount of lines to display for this text. */
  18. total int
  19. /* Current position in current line. */
  20. position int
  21. /* Animation timer. */
  22. animationTimer float64
  23. }
  24. type LongtextFlags int
  25. const (
  26. /* Disable animation of pause marker. */
  27. LONGTEXT_FLAG_STATIC_MARKER = LongtextFlags(1 << 0)
  28. /*- Show letters one by one in stead of space separated words. */
  29. LONGTEXT_FLAG_SHOW_LETTERS = LongtextFlags(1 << 1)
  30. )
  31. /* A descriptor for the configurable size settings of a
  32. * longtext. */
  33. type LongtextSettings struct {
  34. /* Amount of lines to display in one virtual page of text. */
  35. Lines int
  36. /* Vertcal spacing between lines. */
  37. Spacing int
  38. /* Delay between display of the individual characters. */
  39. Delay float64
  40. /* Several flags that modify the behavior of the box. */
  41. LongtextFlags
  42. }
  43. type Longtext struct {
  44. Captioned
  45. Text string
  46. LongtextSettings
  47. LongtextState
  48. }