Author Topic: [Solved] Chat messages does not move up to their tweened position instantly  (Read 2523 times)

Etarnalazure

  • Guest
Hello,

A friend of mine adviced me to get NGUI since as he said "It would make my life easier",

but so far I've wasted 2 days trying to get even the most simpel things to work,
which obviously is beginning to annoy me quite a bit.

I decided then to get the Starlink example hoping I would a bit more insight into
NGUI and its usings but once again, no luck.

So finally I've decided to post here before my head explodes from what is most likely
just my own incompetence;

I'm using the basics from the chat in Starlink, however I am using a dynamic font instead
of that atlast font that is used in Starlink.

I've gotten it working with the normal font, but the text after having been typed refuses
to go up on the chat window instantly, and it just keeps placing the newly writting
messages ontop of each other.

I know theres nothing wrong with the chat objects, since its spawning the labels as it
should, and the labels are placed as they should (I verified this by pausing and checking
the hierarchy) so I dont get it.

Heres a screenshot; http://i.imgur.com/irEzgAG.png

The text however do get moved up.. But not until 2 seconds or so later, and only
if the chat box is not active.

I am out of ideas here..

Also I should most likely point out that all UI elements have been shrunk down since I made my
game before using this kit I cant resize everything to it suddenly fits stuff thats the scale of "x: 20, y: 20, z: 1"
and so on.


Hopefully I could get some help.

I did change the UIChat script though. But thats mainly changing some things to floats and using font.pixelSize instead of font.size.
« Last Edit: August 08, 2013, 10:16:41 AM by Etarnalazure »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Chat messages does not move up to their tweened position instantly
« Reply #1 on: August 08, 2013, 10:03:35 AM »
When using a dynamic font, you need to adjust the transform's Z position to bring it in front. There are two sticky posts on this issue in this forum.

Using a bitmap font like it was in Starlink will make your life MUCH easier, especially while learning NGUI.

Etarnalazure

  • Guest
Re: Chat messages does not move up to their tweened position instantly
« Reply #2 on: August 08, 2013, 10:09:10 AM »
But if that is the reason. Is it not weird that the text does show up at the right area after 2 seconds?

Also incase you cant see on the picture. The text is showing, its just on top of each other untill
it realizes it has to move it to a new position. I even checked the tween thing, it shows the current
position and the position its supposed to move to.


And a third also;

I tried using using that "Arimo" font thing instead of a dynamic font. Same thing.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Chat messages does not move up to their tweened position instantly
« Reply #3 on: August 08, 2013, 10:13:38 AM »
With the base Starlink UI, the new entries are set to grow from height of 0 to height of font size over 0.2 seconds as I recall. You changed it, I'm guessing. New entries also appear at the bottom, and do not get repositioned until a new entry shows up, which then pushes them upwards. So my question is -- what did you change? Create a new project, import the Starlink UI kit and examine it carefully. What's different? Change the font to your dynamic font. Now does it still work correctly? What's different now? Etc.

P.S. And pay close attention to where your root objects are positioned -- label's parent, for example.

Etarnalazure

  • Guest
Re: Chat messages does not move up to their tweened position instantly
« Reply #4 on: August 08, 2013, 10:16:26 AM »
I was right in my first post, it didnt work due to my own incompetence,

I just looked through the gameobjects and realised I had set my panel to static..

Even though I regret buying the Starlink example
(Not because its bad, mainly because the example just dont fit a third person RPG game) I dont regret buying NGUI and TNet from you. You're quite skilled and I'm amazed that you find time to support us this much.

Thanks for the help once more.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Being new to a system is not the same as being incompetent. Every new system takes time to get a hang of, especially one as complex as NGUI that has been around and expanded on for almost two years now. Don't blame yourself, nor NGUI. Just be patient and take breaks when things don't work. Clearing your mind always helps me. ;)

Etarnalazure

  • Guest
Indeed, but you get frustrated when you're stuck on the same things 3 days in a row, and a deadline is coming in. (Starting a job developing a advanced database system for a company thus most of my time will go on that, and then another job aftwards) meaning I wont have time to develop on the game for more than 4 months.

So I would have liked to get as much done as possible :p