Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - schwarzenego

Pages: 1 [2] 3
16
NGUI 3 Support / Re: UILabel Height
« on: February 20, 2014, 06:21:35 PM »
Thanks, that worked! =)

17
NGUI 3 Support / UILabel Height
« on: February 19, 2014, 01:21:32 PM »
Hello,

In NGUI 2.X I remember using something like label.relativeSize.y and that would return the number of lines of the text, which I could use * the height of each line to get the total height of the text. However, I understand that thats changed, and we should use uilabel.height to get the value in pixels. However, heres the problem:

  1. //initially myLabel.text is something equivalent to 1 line of text
  2. print(myLabel.height); //Output 10 (for example, considering 10 pixels per line)
  3. myLabel.text = "asdasdasdasdassad"; //equivalent to 2 lines of text
  4. print(myLabel.height); //Output 10 again, as if size wasnt updated
  5.  

What I am doing to get the correct value is yield return null, but I would appreciate if I didnt have to wait for a frame and use coroutines for everything. Is it possible to get the updated height immediately?

Thanks for your attention,
Best Regards,
Allan

18
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 18, 2013, 03:06:07 PM »
I understand your point, I am an absolute noob at shaders so I guess Im rolling back to NGUI 2.

I just like to ask, isnt it somehow common to have particle effects over the UI? Isnt that possibly a problem? I mean, I use particles as a lot of things, clicking feedback, rewarding feedback, etc etc... I am the only one? Isnt it... well... important?

Anyway, thank you for your attention ArenMook, I wish I could use NGUI 3 but who knows at another time? Also, Id like to suggest over to you to add on to your tweening class a PingPongOnce, I always add it (its very simple), and its quite useful.

19
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 18, 2013, 12:33:18 PM »
Alright, setting all panels to Explicit 3000 worked great for the sorting I was looking for.

However.... now I can't get consistent results using the Depth of UISprites as in NGUI 2, by changing the values sometimes things completely switch positions, sometimes the depth has no effect... and I could just ignore depth and use Z for everything, but Z is having a weird effect on sorting for UISprites/Labels/Etc, by changing the Z of one sprite, other sprites disappear/reappear... so now Z works on NGUI vs Models, but depth and Z are broken for NGUI only components =/

Any thoughts?

20
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 18, 2013, 10:26:49 AM »
So... is it possible to have this:

NGUI -> Particle System -> NGUI -> Particle System?

Should I just row back to 2.7 (or whatever was the last 2.x version)?

21
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 17, 2013, 12:41:19 PM »
Alright, good to know im not doing EVERYTHING wrong =P

So, im trying to do something which is probably not the most recommended stuff but due to how my hierarchy is and how my scripts go, I have one panel for the general menu layer... what I am looking for is to have a particle that goes behind one of the buttons, but ahead of the buttom`s background frame. So, before, I had only one panel with a ton of stuff.

Now, since I make some tweenings of a lot of stuff, I wanted the buttons to stay in the same panel as the background, so I can tween em all together. Since I HAVE to add another panel for the sandwich, I just added a UIPanel to an empty game object, which holds the button. However, in the hierarchy it is a child of the original panel, basically one panel inside the other. Is this a problem?

Also, by toying with the Render Queue number of both panels... Ive noticed there is some stuff not even related to NGUI (my scenario model) that is actually changing... some misterious shadows are appearing out of nowhere by changing this number... and still I am not being able to have the particle in between the two panels, either its in front of everything or its behind everything... is it because I have a panel inside a panel?

And... should my scenario be changing based on the gui panel render queue? =P Man I gotta say... I am starting to miss my beloved Z axis...

Edit: Even taking the inside panel outside of the hierarchy of the first panel... I cant get the particle system behind one and ahead of the other panel... its either behind both or in front of both... as if the Render Queue was not by panel but by whole UI... by Camera... something like that...

Edit2: Ok, I managed to get the particle system behind one panel and ahead of another... problem was that ALL panels in the scene must be "Render Queue: Start At", or else they all just start at 3000 anyways. However....................... What if I need to play ANOTHER particle system, but this time ABOVE the buttom and everything? In other words... Panel -> Particles -> Panel -> Particles... is it even possible?

22
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 17, 2013, 12:25:17 PM »
So... ran into this problem again, now with a shuriken particle... I want it to be behind some of the elements and ahead of others... and Im unable to place it correctly... Actually not even if I wanted it in front of other stuff, its just not possible...

By changing the Render Queue to "Start At" and using a low value, I can get the particle system ahead of NGUI elements, but then I suppose I would need 2 panels to have stuff on different render queue positions...

Usually I try to have panels as "layers", so if everything is roughly the same layer of hud they are all in the same panel... would you recommend having more panels and things more divided or only when needed for some reason?

23
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 17, 2013, 11:40:24 AM »
Oh cool, I didnt knew UITexture at all...

In this specific case it does solve my problem, thank you. However, due to the overhead of UIPanel.Update I try to reduce the usage of widgets as much as I can (if im going to move them around and not change alpha/color (which I do using your Tween class)) for example, I have a kind of Talent Tree in my game where the user can navigate around, its more like a map than a tree... at first I was doing it fully with NGUI, background image, everything, but once the user moved around the map, the FPS decreased drastically due to UIPanel.Update. I then switched the background tiled sprite to a primitive plane with a tiled unlit texture, and a few other elements which I would not change at all... and performance drastically increased (from 10 to 60 fps on some devices)... What would be your counsel, was I doing something wrong in the first place or I should really avoid NGUI for some kind of stuff?

Well, once again thanks for your help.
Best regards,
Allan

24
NGUI 3 Support / Re: Regular model in between NGUI layers?
« on: December 17, 2013, 11:17:00 AM »
I havent but really, Id like to avoid doing that. I would need 3 cameras... one for the back GUI, one only for the plane, and one for the front GUI... or at least 2 with the plane on the popup Camera... I suppose that multiple cameras have some overhead on performance (to be honest Im not sure but I would guess so), and it would make a total of 3-4 cameras... for this specific case I dont think performance would be a problem, but I might need to do this in other scenarios where it is a problem... is there no solution to this?

25
NGUI 3 Support / Regular model in between NGUI layers?
« on: December 16, 2013, 05:39:16 PM »
Hello, how are you?

I've noticed that since NGUI 3.0 the Z vs Depth has changed quite a lot, which on one side I find good and on the other it is causing me a bit of trouble.

Truth is I dont use NGUI for everything HUD related in my scene. The extra drawcalls I get from using primitive shapes with textures sometimes compensate for the UIPanel.Update when things are moving, so I actually try to avoid using NGUI for (mostly) static stuff. However, the real problem is when I try to have something in the middle of NGUI sprites... I have a plane which gets a texture from Resources.Load (to use less memory and since it can be one in many images I cant have that on an Atlas), and it is a background image of an NGUI Popup. No problem there... however, there are a few NGUI elements that I wish were BEHIND this primitive plane... but since NGUI now ignores Z somehow, I dont know how to put this plane behind the NGUI popup and in front of the other NGUI HUD going behind...

Any ideas?

On the image bellow, I want the highlighted stuff behind the white plane.

26
NGUI 3 Support / Re: Rigidbody in Panels
« on: December 12, 2013, 07:45:44 AM »
I do change the matrix to make sure there are no collisions, to be honest all my ui colliders are triggers, but actually I did a quick search now since I had honestly never thought of that... and for my Input class I use raycasts to check if I did touch or not on something (I think there is no other way really) but with the rigidbody I was constantly getting hit information on the Panel and not the buttom I tried hitting... but if I check for hit.COLLIDER.transform (instead of only hit.transform)... that is the real deal...

So in the end, the kinematic rigidbody seems to be a good idea =)

Thanks for the answers tho!

27
NGUI 3 Support / Rigidbody in Panels
« on: December 11, 2013, 10:16:16 PM »
Hello,

I understand why you had rigidbodies attached to panels, they certainly do reduce the static collider calculation on move and at certain times we do have buttons moving around... BUT, the rigidbody also unifies the colliders as "one body"... its not really a merge but they count as one for collisions...

I've commented out the part of the code that adds the rigidbody, and I dont know if there is a real solution to the static collider problem, but I have a custom input script more suited for my needs and I just cant have that rigidbody there, unfortunately.

I would suggest making a bool on the panel script to add or not a rigidbody... i know it is pretty easy to just go there and comment the code, obviously, but I suppose I will have to do that in every release, and I am sure there are more people with this kind of problem other then me. Actually, is that the reason you've added the rigidbody in the first place, for the static collider move overhead?

Best regards,
Allan

28
Other Packages / Re: HUDText - All letters Black
« on: July 12, 2013, 02:40:48 PM »
I dont know exacly what was causing it... actually I have no idea... but I've created a new font and it is working again... in another words, there was something I did on the other font that prevented it from working on some android devices... =/ If by any chance I discover or repeat the error, I will let you know what it is.

Thanks for the support anyway!

29
Other Packages / Re: HUDText - All letters Black
« on: July 10, 2013, 03:50:09 PM »
Im using NGUI 2.6.3 and HUDText 1.6. There can be quite a lot of scrolling combat text during my game at the same time, but the CG calls reduce quite much the performance of my game, which is already on the edge with 40 enemies on screen...

I've re-checked the project settings (all of them) and they are pretty much the same, except for Stripping Level, which on the previous project was mscorlib and on this one is disabled. Ive set up the cameras as you've suggested, but the same thing happens. I've even tried changing the text shader, but always with the same results. It is as if fonts were being rendered all black...

On the other project however I do not use HUD Text, only NGUI regular features, I had another system for scrolling combat text, decided to switch to HUD Text cause it was Unity GUI based.

30
Other Packages / Re: HUDText - All letters Black
« on: July 10, 2013, 09:55:19 AM »
Doesnt work, same problem =/

This is my second project with NGUI, on the first it works perfectly on these same devices, and this one, which is a simpler than the other, this error is happening =/ Have any idea of what could be?

Also, let me ask you, on this project I have a lot of units on screen (max 42, for mobile). I've noticed that when they all are taking damage (thats when I call HUDText for scrolling combat text), the profiler indicates a high load on the UIPanel.LateUpdate() and constant GC.Collect() calls that use up to 10ms each (these calls happen like every 30 frames while the text is being displayed). Is there some kind of optimization I could make in any way?

Thanks for your attention,
Best regards,
Allan

Pages: 1 [2] 3