Author Topic: A Chat Log that contains lots of text  (Read 4832 times)

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
A Chat Log that contains lots of text
« on: October 06, 2012, 08:54:43 PM »
Hi!  I created a chat window that uses draggable panel, please see attachment.  It can only hold about 160 lines of text before reaching the limit:
"Too many vertices on one panel"  The chat window  is really just a UIDraggablePanel with a Table in it, and a list of UILabels, nothing fancy... I tried each UILabel holding 1 line of text, so about 160 UILabels, and I tried grouping then so Each UILabel holds about 10 lines of texts which is about 16 UILabels... I guess it made no different, the labels are creating too many vertices and has nothing to do with how they are organized.

So I'm wondering is there anyway around this? 

Thanks again

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #1 on: October 07, 2012, 12:37:59 AM »
Get rid of the outline effect. Outline draws the text 5 times instead of once. If you need an outline effect, bake it into the font.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #2 on: October 07, 2012, 01:04:05 PM »
For some reason when I made the labels have effect = NONE, the UIPanel clipping no longer clips.. so the texts will show even outside the clipping area.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #3 on: October 07, 2012, 02:04:14 PM »
Otherwise, you have to be "smart" about it, and actively remove/disable the labels that are clipped. So that only a fraction of the total is enabled and drawn.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #4 on: October 07, 2012, 02:24:50 PM »
Do you mean I should remove the effect:Outline and use baked outline, and enable/disable the items via my own code?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #5 on: October 07, 2012, 07:36:48 PM »
When you remove the effect the panel no longer clips? o_O? There is no reason for this to happen at all. The shader doesn't change. Look closer at what else is happening.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #6 on: October 07, 2012, 08:57:43 PM »
haha, that's the only thing that I change.. I change the effect back and it clips.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #7 on: October 07, 2012, 09:02:40 PM »
let me look deeper to see if i could have done anything else

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #8 on: October 07, 2012, 09:15:36 PM »
OK just FYI, I figured out what the problem was.  As you said effect had nothing to do with it.  But when I dragged the item prefab into the hierachy window, it automatically added a uiroot and a uipanel to the prefab, so when I applied the removaly of the effect, I unintentionally added the uiroot and uipanel component to the prefab of the item.  I guess that caused the items not to clip LOL.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #9 on: October 10, 2012, 06:09:24 AM »
Otherwise, you have to be "smart" about it, and actively remove/disable the labels that are clipped. So that only a fraction of the total is enabled and drawn.

Shouldn't this support by default by NGUI ?
I think there is no case where this is not needed, right ?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #10 on: October 10, 2012, 06:26:19 AM »
Shouldn't this support by default by NGUI ?
I think there is no case where this is not needed, right ?
It would be a nice feature, yes.

Goosery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #11 on: October 10, 2012, 07:42:22 AM »
Yup this is supported by ngui, I just had the setup wrong(see above) that's why it misbehaved.

Note, draggable panel will have all sorts of weird behaviors if any of it's parent hierachy is not 1x1x1, this includes even just a plain non-ngui game object, also the panel itself needs to be 1x1x1.  I spent all day to figure that one out.  Side effects include clipping the entire content instead of the edges as you scroll

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: A Chat Log that contains lots of text
« Reply #12 on: October 10, 2012, 07:43:50 AM »
Hum, this is supported by NGUI when you're not dragging, but when dragging it enable everything.