Author Topic: ScrollView Example 7 Spring Momentum & TweenAlpha question  (Read 4999 times)

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
ScrollView Example 7 Spring Momentum & TweenAlpha question
« on: December 17, 2012, 06:40:06 AM »
Hi,

I've been recreating the scrollview from example 7 (clipped panel). But with lesser items in the UIGrid. I have 12 items in the Grid but i can't get te scrollview to align the images properly. Check the screenshots below:

Normal


Drag Right


Drag Left


As you can see the last image (on the left or right depends on which direction your scrolling), is always aligned to the center instead of the edge of the panel.

And another question, can i TweenAlpha an UITexture? I had the background texture win my atlas first then TweenAlpha worked on it. But now i have the same texture as a UITexture and now my TweenAlpha doesn't work anymore.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView Example 7 Spring Momentum & TweenAlpha question
« Reply #1 on: December 17, 2012, 09:42:33 AM »
In that example the items align to the edge if the "center" option is not checked. If it is, the closest item to the center of the panel is used instead. My guess is you are using that without realizing what it does.

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: ScrollView Example 7 Spring Momentum & TweenAlpha question
« Reply #2 on: December 17, 2012, 10:22:58 AM »
Thx man that helped! It's working perfectly now.

Now on to the other question, how about the TweenAlpha on an UITexture?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView Example 7 Spring Momentum & TweenAlpha question
« Reply #3 on: December 17, 2012, 11:45:48 AM »
You need to use a shader that has alpha for your UITexture such as "Unlit/Transparent Colored". By default textures use "Unlit/Texture" as I recall, which doesn't have an alpha component to work with.

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: ScrollView Example 7 Spring Momentum & TweenAlpha question
« Reply #4 on: December 17, 2012, 01:41:22 PM »
Thx ArenMook it works perfectly now :)