HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 ... 6 7 [8]

Author Topic: How to make a simple scrollable chat window  (Read 36558 times)

SilverDK

  • World Owners
  • ****
  • Posts: 15
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #105 on: Mar 01, 13, 08:34:57 PM »

I think I solved it now.

I simple changed the OpenChatInput method to create an instance of my chat window if it couldn't find it.

The method code is changed to this:
Code: [Select]
method OpenChatInput(command as Boolean)
  chatWindow as NodeRef of Class KNA_ChatWindow = me.GetChatWindow()
  if (chatWindow == 0)
    chatWindow = CreateNodeFromPrototype("KNA_ChatWindow")
    chatWindow.build = true
  .
  chatWindow.SetChatFocus(command)
.

I hope that it can help others..

Thanks for reading
Logged
Kim Andersen

Lead Programmer @ Happy Mares Studio

GameMMO

  • World Owners
  • ****
  • Posts: 19
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #106 on: Mar 26, 13, 06:13:25 AM »

If you set "true" in the "Scrollable" -> "Clientarea", "AllowStickyBottom" you have auto-scroll to down :D
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #107 on: May 01, 15, 06:11:15 PM »

Anyone got a line wrap functionality into one of these? If yes, can you please post the relevant code so that i don't need to reinvent the wheel.

Cheers
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: How to make a simple scrollable chat window
« Reply #108 on: May 01, 15, 06:41:58 PM »

If all viewable player chat is sent to the clientArea in the scrollable, it normally has multiline set by default and should wrap. Should be on each _label by default.
« Last Edit: May 01, 15, 07:02:27 PM by Thazager »
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #109 on: May 01, 15, 06:45:55 PM »

If all viewable player chat is sent to the clientArea in the scrollable, it normally has multiline set by default and should wrap. If not check the cientArea gui for that being set.

Not sure if i understand. Can you please post a screenshot?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: How to make a simple scrollable chat window
« Reply #110 on: May 01, 15, 07:00:55 PM »

Ok, some details.

When a player chats, the message is written up on a _label.

   value as string = player.name +"says: hello world."
   label as noderef of GUILabel = FindGUIControlByName(win, "output")
   label.text  = value

That label is then pasted to the client area:

   add back mesg to clientarea.children

On the _label gui in section textformat field singleLine, the value is set to false.  So, it will use more than 1 line by default.
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #111 on: May 01, 15, 07:21:05 PM »

Quote
On the _label gui in section textformat field singleLine, the value is set to false.  So, it will use more than 1 line by default.

Hmmm, interesting... i didn't know this is possible. I will check if it works and get back. Thanks.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: How to make a simple scrollable chat window
« Reply #112 on: May 01, 15, 08:09:59 PM »

Besides singleLine (which needs to be false) there is also a field WordBreak that needs to be true.  I found occasionally that even with these fields set as such, putting a string into the label still shows on a single line. In those cases, setting WordBreak to false then back to true again fixes it.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #113 on: May 02, 15, 03:03:43 AM »

Heh, thanks. One can never get enough of them workarounds.

Have you noticed though, that if you set allowStickyBottom to true. And then move a scrollbar manually, the autosticky scroll to bottom stops working? How do you fix that?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: How to make a simple scrollable chat window
« Reply #114 on: May 02, 15, 10:57:28 AM »

Sticky bottom is intended that way, that it only scrolls down when a new item is added and the scroll was already all the way down.  If it is not all the way down, nothing happens.  I think that is probably good since you may have been viewing an item higher in the list at the time and thus not want it to scroll to the bottom.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #115 on: May 02, 15, 12:06:47 PM »

Now that i think about it, makes sense.
Logged

arrestedgames

  • General Accounts
  • *
  • Posts: 14
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #116 on: May 24, 15, 09:15:40 AM »

im bummed because this looks like a great tutorial, but all I see for images is the ImageShack yellow frog :(
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: How to make a simple scrollable chat window
« Reply #117 on: May 25, 15, 03:44:30 PM »

This tutorial had pictures from the old DOM. He might be updating those pictures to show how things work in the new DOM.
Logged
Pages: 1 ... 6 7 [8]