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

Pages: [1] 2 3
1
NGUI 3 Support / Collider on Top?
« on: August 27, 2014, 05:56:59 AM »
Hi, I would like to add a Box Collider to a game object which has a Unity2DSprite (not ngui) that covers the whole screen and therefore disables all of the NGUI elements.

Currently the NGUI buttons still receive the clicks although the is a collider above it.

What do i need to do to make this collider capture the events so that ngui does not?

Thanks

2
NGUI 3 Support / Re: UIScrollView Strange snapping
« on: August 22, 2014, 05:12:50 AM »

3
NGUI 3 Support / Re: UIScrollView Strange snapping
« on: August 22, 2014, 05:06:45 AM »
I've uploaded a gif to try and demonstrate the problem, you can view it here (80mb):

My "map" is in a horizontal scrollview with a drag component. When I drag from the left side it works fine but when I drag the the right side at the end of the scrollview it automatically snaps back to the end even though I am still dragging it.

I am on v 3.6.7. I have not updated to the very latest release because the removal of the BetterList and various issues that means my UI doesnt work like it did.

4
NGUI 3 Support / UIScrollView Strange snapping
« on: August 22, 2014, 04:38:32 AM »
Hi I have a uiscrollview and the snapping has started acting strangly. The "MomentumAndSpring" is acting more like an EaseBack.

Any ideas what could be wrong?

5
NGUI 3 Support / Cropped UILabel
« on: August 07, 2014, 11:29:41 AM »
Hi, the text in some of my UILables is slightly cropped (hard edges on the bottom and right edges). Is there a way to fix this/force extra padding?

It it an off pixel thing?

I'm currently using "Unity Font" option.

6
NGUI 3 Support / Re: Custom Anchors on hover?
« on: August 07, 2014, 11:25:37 AM »
Hmmm... Im on version 3.6.7, i skipped the latest because of a few other issues.

In the mean time I found another solution, I put all my buttons inside a widget and anchored the widget and scaled that instead. It works so will keep it like that until next time.

Thanks for your help and looking into this.

7
NGUI 3 Support / Re: Custom Anchors on hover?
« on: August 05, 2014, 04:10:23 AM »
Hi, so I am doing this as it is a special design request that the buttons be smaller on certain devices. I have to manage this manually and hence the scaling of anchors. They are already using a Fixed size root but on some devices they have to change size for different layout designs.

I just testing my code using the older "UISprite" and it works. "UI2DSprite" does not work.

If you create a Sprite with a UIButton component and set a hover sprite and give the buttons a Unified anchor. Then attach a custom component and add the following code to its "Start()" method you will see that as you hover over the button, the new sprite appears and is also scaled based upon the anchor.

  1. void Start() {
  2.     UISprite sp = gameObject.GetComponent<UISprite>();
  3.     if( sp.isAnchored ) {
  4.         sp.leftAnchor.absolute /= 2;
  5.         sp.rightAnchor.absolute /= 2;
  6.         sp.bottomAnchor.absolute /= 2;
  7.         sp.topAnchor.absolute /= 2;
  8.  
  9.         sp.ResetAnchors();
  10.         sp.UpdateAnchors();
  11.     }
  12. }
  13.  

If you do the same as above but add a UI2DSprite, when you hover over the hover state does not appear scaled but in its original size and when you roll off the button the normal state also appears in its original size. The anchors are ignored.

Would it be possible to have the UI2DSprite work like the UISprite?

Also I tried the code you suggested above on my hover but due to my anchors scaling, the buttons move causing an "hoverOn" > "hoverOff" > "hoverOn" > "hoverOff" loop.

8
NGUI 3 Support / Re: Custom Anchors on hover?
« on: August 04, 2014, 11:24:42 AM »
Hi, sorry for the confusion, heres what I am doing.

I have a bunch of UIButtons. I have set the anchors of these via the inspector. I also have a "Manager" script and in its "start" method, I iterate over the buttons and changes their anchors (if dpi is low, I half the size anchors with the code posted above).

So this results in my buttons still being anchored similar to how i set them up in the inspector but their size is halved. This is what I would expect. The problem is that when I "Hover" over these buttons, the UIButton shows the "hover" state which is a different sprite. This hover state does not have the scaled anchor applied to it.

I would have thought that the hover state would have the same anchor settings as the "normal" state but it does not.

The only fix I can see is to use the OnHover callback and set the anchors every time I do a "hover" event.

Does that make sense?

9
NGUI 3 Support / Re: UIWrapConten in 3.6.8 BUG?
« on: July 31, 2014, 12:02:46 PM »
Ah right...

I need to use the grid to access the items within it but want them to scroll endlessly.

I have manual scroll left and right btns, these find the next item in the grid and move the scrollview to that position.

Any ideas?

10
NGUI 3 Support / UIWrapConten in 3.6.8 BUG?
« on: July 31, 2014, 04:21:43 AM »
Hi I have just updated and all my scrollviews with grid that are wrapped have broken. I have replaced any instances of "BetterList" with "List" and I presume it is something related to this.

If i enable UIWrap which is attached to my Grid, range limits set to 0 - 0 and cull = false. Everything appears out of order and never gets into the correct order.

My grid is alphabetically sorted.

Thanks.

[Edit:]
 I have since also experience s few strange things such as:
- crasheswhen scrolling the scrollview with a grid within it.
- anchors not being set corrected when game object are being reactiveated (might have always been like this)

I have had to revert back to 3.6.7 for my game.
[]

11
NGUI 3 Support / Re: ScrollView - Soft clip at bottom only?
« on: July 31, 2014, 03:44:37 AM »
Hi I don't understand how the two scroll views would work.

I want to scroll a large UILabel full of text. I want the top the be hard clipped (you can see the text getting cut off) but I would like the bottom text to be faded so the bottom of the view is transparent leaving only a certain amount visible at the top to the middle.

12
NGUI 3 Support / Re: Custom Anchors on hover?
« on: July 31, 2014, 03:40:39 AM »
AH... So I am not doing anything on the "OnHover" method. I thought that because I had set the achor on my UIButton, any sprites it uses for its states would also use the anchor.

So do I have to attach a custom OnHover to all my buttons? Can I not set it to the UIButton?

Thanks.

13
NGUI 3 Support / Custom Anchors on hover?
« on: July 30, 2014, 04:50:59 AM »
Hi, I am changing the anchors on some buttons at runtime which works but when I "hover" over the button the hover state does not account for the new anchors.

eg: My buttons are 100px by 100px. They are anchored. I adjust the anchors so the buttons are not 50px by 50px. When I hover over the buttons, the hover state is displayed at 100px by 100px not honoring its anchors.

Also I am using UI2DSprites.

  1. UI2Dsprite btn;
  2.  
  3. if( btn.isAnchored ) {
  4.     btn.leftAnchor.absolute /= 2;
  5.     btn.rightAnchor.absolute /= 2;
  6.     btn.bottomAnchor.absolute /= 2;
  7.     btn.topAnchor.absolute /= 2;
  8.  
  9.     btn.ResetAnchors();
  10.     btn.UpdateAnchors();
  11. }
  12.  
  13.  

Thanks for any help.

14
NGUI 3 Support / Scroller Padding?
« on: July 18, 2014, 05:09:30 AM »
Hi how could I add some padding to my scroller so I can scroll it further. I have a long text field and when the scrollerbar is at the bottom, I would like the contents of the scroller to be slightly higher than the bottom of the scroll view.

With text I could manually add some empty lines but I am using a UIGrid and adding prefabs, I guess I could add an empty prefab at the bottom?

Also my grid is dynamic so I sont think I could use row limit.

Thanks

15
NGUI 3 Support / Re: Getting 3D objects with custom shaders clipped
« on: June 30, 2014, 10:52:54 AM »
Hi is there a way to have the 3D objects clipped and animated. Would this mean constantly updating the UITexture. Is that something that should not be done?

Pages: [1] 2 3