Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by VenomUnity · Sep 02, 2013 at 03:22 AM · androidguitexturescrollview

Scrolling gui texture up and down, Android

I am making some android prototypes and I need help from community for an issue. I have a long image(1280p wide and 2534p height). I want the user to scroll with finger this image up and down to read it's content. Can someone point me to some resources or solutions. Below is the image that I created to tell the storyline of the game. Sorry that I blurred it.

alt text

\

alt text

in ap.jpg (62.2 kB)
storyline 2.jpg (186.1 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ShadoX · Sep 02, 2013 at 07:11 AM 0
Share

$$anonymous$$ost probably not the best solution, but have you tried just placing it in front of the camera, making sure that it looks alright, and just adjusting the camera position (or image position) when the user does the up/down motion? All you really need for that would be to know how to do the touch recognition.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by robhuhn · Sep 02, 2013 at 07:47 AM

An approach would be to get the touch position in word space, calculate a velocity (previous - current) and move the camera down or a container up.

 Touch touch = Input.touches[0];
 touchPosition = touch.position;
 touchPosition.z = -camera.transform.position.z;
 touchPosition = camera.ScreenToWorldPoint(touchPosition);

 ...

 velocityY = touchPosition.y - previousTouchPosition.y;

 ...

 //apply velocity
 newPositionY += velocityY;
 camPosition.y = newPositionY;
 camera.transform.position = camPosition;
 
 previousTouchPosition = touchPosition;

I didn't test the code and some features are missing e.g. decrement the velocity when there is no touch and check for top and bottom bounds.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android touch and drag GUItexture problem 0 Answers

Scroll view/rect broken on Android only 0 Answers

Scroll content disappears after trying to scroll on Android, on different aspect ratio devices. 0 Answers

HUD on Android/iPhone : GUITexture or OnGUI (drawTexture) ? 2 Answers

Strange collision problem with block and terrain 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges