Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

iOS Scroll Effect - SceneGUI Objects

$
0
0
Hello, I'm creating a GUI within my scene (using planes, and quads basically - *Not OnGUI*) and I want to be able to scroll a quad up and down via the users finger slide. I want to mimic the iOS scroll effect really. I've looked at a couple of plugins that automate this such as 'FingerGesture' though that doesn't actually have any support for real time scroll effects. Although it make my job a little easier by using the DeltaTime: I guess I can make my own by simply using the Input.GetButtonDown("Fire1"), so I did this: function OnDrag(gesture : DragGesture){ var phase = gesture.Phase; var deltaMove = gesture.DeltaMove; var totalMove = gesture.TotalMove; //print("Drag: [Phase] " + phase + " [Delta] " + deltaMove + " [Total] " + totalMove); if(slider.localPosition.y >= 0.37) slider.localPosition.y += (deltaMove.y / 360) / 2; else slider.localPosition.y = 0.37; } This allows me to slide my content up and down, although I would like to add the same bounciness you get on the iOS. Also, the content flickers when I pull my content down, past 0.37 (because its being reset). How can I avoid the flicker? And add a bounce? Thanks

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>