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

Pages: 1 [2]
16
NGUI 3 Support / Re: Long Popup List
« on: June 13, 2013, 12:29:56 PM »
Could this be a rounding error? Or is this a completely wrong approach?
I need quick help. Thank you!

17
NGUI 3 Support / Re: Long Popup List
« on: June 13, 2013, 09:13:44 AM »
Thank you!

I found this:

"You can read the actual screen size in Screen.height and compare that with the value UIRoot has calculated, to figure out your widget's actual pixel size on the screen." (http://www.tasharen.com/forum/index.php?topic=3162.0)

I have now tried it so:

int nItem = (int)((fDelta / (font.size * textScale + padding.y))*(transform.root.GetComponent<UIRoot>().manualHeight/Screen.height));

It seems to work with:

UIRoot.manualHeight=960
Screen.Height=480

Pixel Size is 2

but not with:

UIRoot.manualHeight=1136
Screen.Height=854

Pixel Size is 1.3302...

Is this the right way? Maybe you have a solution?

18
NGUI 3 Support / Re: Long Popup List
« on: June 12, 2013, 03:32:58 AM »
Nobody can help me?

19
NGUI 3 Support / Re: Long Popup List
« on: June 11, 2013, 04:10:20 AM »
What do I need to change in GetSelectedItem(), so that it works with "FixedSizeOnMobiles"? It works correctly only with "Pixel Perfect" in the UIRoot. I am grateful for any tips.

    UILabel GetSelectedItem()
    {
        //. determine which label will be selected
        Vector3 panelPos = UICamera.currentCamera.WorldToScreenPoint(mChildPanel.transform.position);
        float fDelta = panelPos.y - UICamera.currentTouch.pos.y;
        int nItem = (int)(fDelta / (font.size * textScale + padding.y));
       
        if (nItem < 0 || nItem >= mLabelList.Count)
            return null;

        return mLabelList[nItem];
    }


20
Thank you! Works great. :)

21
How can I jump to a certain item directly? There is only the possibility over scrollBar.scrollValue()? I would like that my list will scroll to the required item.

Regards,
Russel

22
Thank you! Of what exactly should I check the position? Do you have a small example?

23
Hey!

How do I get an event when I have reached the end of the scroll bar? I need the event to reload new content.

Pages: 1 [2]