Author Topic: Dialogue for Typewriter effect  (Read 105 times)

weilies

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
Dialogue for Typewriter effect
« on: February 15, 2017, 11:22:11 PM »
Greeting,

Is it possible to show text with a "pause" in NGUI label?
E.g. "Hahaha.... {wait for 3 seconds} I wanna kill you~~!"
I only know it will pause at "." and not any point of the label

Secondly, how can i show newline (ENTER) in label text property?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 261
  • -Receive: 1124
  • Posts: 21,775
  • Toronto, Canada
    • View Profile
Re: Dialogue for Typewriter effect
« Reply #1 on: February 18, 2017, 06:51:58 PM »
Typewriter script is just an example. You can edit it as you like. It does have a "delay on new line" option btw -- how long to pause on a newline character. A newline character is '\n'.

weilies

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: Dialogue for Typewriter effect
« Reply #2 on: February 21, 2017, 03:14:01 AM »
I tried to change the label during runtime using Playmaker NGUI integration.

The end result display "\n" on screen rather than give me a line break.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 261
  • -Receive: 1124
  • Posts: 21,775
  • Toronto, Canada
    • View Profile
Re: Dialogue for Typewriter effect
« Reply #3 on: February 21, 2017, 12:46:34 PM »
Not sure about playmaker, but I'm guessing it doesn't use a multi-line input field. NGUI does, so when you press enter when editing the label's text, it creates a new line. Check with that plugin's author.

If you type \n in inspector, it's two characters. The \n is only processed when done via code, which is why I mentioned. In inspector on NGUI's side, you just press enter. Playmaker though? No idea...