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 - Nubeh

Pages: [1] 2 3
NGUI 3 Support / Re: implement shake animation on anchored button
« on: September 08, 2014, 02:17:50 AM »
as a note: I'm using the legacy Anchor and Stretch components...

NGUI 3 Support / Re: implement shake animation on anchored button
« on: September 08, 2014, 02:17:05 AM »
Hi there, thanks for your reply. How to you do it exactly? I tried to attach a tween scale component to one of my buttons, then I get the component with myButton.gameObject.GetComponent<TweenScale>(); and I call Play() but the animation doesn't play. It seems though that the collider box does animate, but not the sprite of the button.


NGUI 3 Support / implement shake animation on anchored button
« on: September 04, 2014, 07:46:04 AM »
I implemented my gui with different buttons that are all anchored and stretched in order to adapt to multiple screens resolutions. I want to add a shake animation to some of them to be triggered via a script but I was wondering what's the best way to approach this because the anchor script will always keep my button element at the same position. Is it possible to use the NGUI Tween class without disabling the anchor component? Thanks.

NGUI 3 Support / Re: strange sprites artefacts at the borders
« on: August 27, 2014, 04:46:16 AM »
oh, I had it set to 2px but now I set it to 5px and it seems to work. Thanks!

NGUI 3 Support / strange sprites artefacts at the borders
« on: August 26, 2014, 09:16:00 AM »
I'm experiencing some weird issues with some of my sprites. I have all of them packed in an atlas and every single image is set to Texture with Alpha is Transparency. It happens that some of the sprites when used in a view have some thin lines around the border. It's strange because it happens only with some of the sprites. I tried to add some transparent border to such sprites and then setting the border in the sprite editor to 2px but it doesn't change. The effect is also very inconsistent, sometimes only some instances of the sprite have artefacts, sometimes the artefacts are only visible when deployed on device but maybe they are visible on an iPhone but not Android. Any idea what the reason could be? Thank you.

the problem with using a fixed font size is that I don't know anything about the length of the text coming from the server (also because I have translations so a short word in English can become a long word in Italian, German or French). In my GUI I want to allow only for a maximum width of the text so that it doesn't overlap with other gui elements. That's why I wanted to let the text shrink and then use the minimum font among the labels.

I have 3 labels with a fixed width and height where I change the text (always one word only) dynamically. Because I don't know the length of the word beforehand I set the label to ShrinkContent. The problem now is that when a word in label 1 is short and the one in label 2 is long then the dimensions of the font for the two labels is different.
Is there a way to set the smallest font size among all 3 labels so that the text inside them looks all the same size?


NGUI 3 Support / Re: UIAnchor and UIStretch
« on: July 24, 2014, 03:29:31 AM »
ok I'll try it out. I was used to the old anchor and stretch component and this new system is a bit counterintuitive for me. That said, using the old anchor and stretch is it really bad for performance at the moment?

And using OnEnable in the new system is it going to work fine when many elements have to get positioned depending on other elements positions? If all elements position themselves in OnEnable (which is called for all components at the same time) how can you guarantee that the anchor target is already at the correct position when OnEnable is called?
This problem was happening when the gui was built in the editor with the iPad settings and then the game is built and run on an iPhone 5. In this case the gui will adapt at start but I always had some components in the wrong position if I did check the only run once tick box.

NGUI 3 Support / UIAnchor and UIStretch
« on: July 22, 2014, 02:48:56 AM »
I have a question about these two deprecated components. I'm working on mobile and I really like these two components because it seems to me that it's much easier with them to create a button that is padded 10% from the right of the screen and stretched 40% of the screen width. With the new anchor system shown in the tutorials it's not really clear to me how to do that quickly and there's all those pixels values that I don't really need because my gui has to work on many different devices.

I was wondering if it's not recommended to use UIAnchor and UIStretch for performance reasons and also if there's a way to not have the "run only once" activated. I noticed that if "run only once" is active some of the elements are not placed or stretched correctly when I switch between views.
If "run only once" is active I notice in the profiler that the performance is pretty bad sometimes and that a lot of CPU is spent in the anchors and stretch updates functions.

NGUI 3 Support / Re: Atlasmaker / Fontmaker problem
« on: July 16, 2014, 02:49:51 AM »
Good to know this. I thought that textures to be packaged into atlas needed to be set as Texture. Does the bug appear also if the sprites are imported as Texture? Which settings do you recommend with the Advanced setting to create the atlas correctly (compression, mipmaps etc.)?

NGUI 3 Support / Re: UITexture randomly gets changed into a UISprite
« on: July 14, 2014, 08:11:12 AM »
oh I see. My problem was that I needed to use the same picture as sprite and as UITexture so I had it the atlas but I didn't want my UITexture to change into UISprite because I had to override the image of my component with an image downloaded from the web. I still think there should be a warning message before NGUI overrides a component that way because this issue made my game crash for days and I had a REALLY hard time to figure out what the problem was because I didn't notice that my UITexture was changed at edit time of the atlas. Thanks

NGUI 3 Support / Re: UITexture randomly gets changed into a UISprite
« on: July 10, 2014, 07:02:00 AM »
holy shit, I didn't know this...that's not a cool behaviour. Thanks for the info!

NGUI 3 Support / UITexture randomly gets changed into a UISprite
« on: July 10, 2014, 02:35:59 AM »
Hi there,
I'm using 3.6.6 and I've tried to create a UITexture with a button script and collider. The reason I use a UITexture is because the image for the button is downloaded from the internet, saved in memory and then loaded when needed. I noticed though that regularly, and it's not clear to me when, the UITexture component is replaced by a UISprite, thus making my game crash when I try to access the mainTexture parameter that UISprite doesn't have obviously.
Is it NGUI that changes that when I build my project for iOS or Android? Or is it Unity that does that? Again, I have no idea when this happens exactly, but after a bit I notice the error and I see that the UITexture has become a UISprite class.
Any idea why that could be? Is it because I attached a button component to it?


NGUI 3 Documentation / Re: UIScrollBar
« on: June 25, 2014, 08:00:49 AM »
I tried to listen to OnDragFinished the same way I use OnChange on the UIScrollbar component but I get the error:

The best overloaded method match for `EventDelegate.Add(System.Collections.Generic.List<EventDelegate>, EventDelegate)' has some invalid arguments

Is it that the parameters in my handler are wrong? I can't figure out what to use there (I tried nothing, GameObject sender, Vector2 delta....).

Thank you. I will try this. One little add on to the question always related to positioning. Sliders have the thumb sprite that goes left-right (in the case of a horizontal slider). If I want to have a label that follows the thumb position I can calculate the position the way you mentioned, but is there a simpler way to anchor an object to the thumb of a slider? The thing about the thumb sprite is that it seems that the sprite doesn't move, only its Box Collider changes the X coordinates. I guess that's because of the way it's implemented.

Pages: [1] 2 3