Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by demonpants · Jan 21, 2016 at 09:16 PM · inputtouchesdimensionstv

Get touch area dimensions for indirect touches (like tvOS or PS4 controller)

Hi. I'm developing for Apple TV, but this question concerns all inputs that have indirect touches.

Specifically, I want to process a user's touch relative to the center of the touch area. To do that, I need the dimensions of the touch area. This is different from using the screen size, which works for direct touches like on iOS.

I know the area is 800x800 so that's hardcoded for now, but obviously that will break if they change their specs or if I try to port this to PS4 or something.

So does anyone know how to find the dimensions of an indirect touch area? Thanks.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by hexagonius · Jan 24, 2016 at 11:04 AM

I think the full support is only available to the corresponding build platform. In this post for example they talk about the full support of the PS4 controller:

http://blogs.unity3d.com/2014/06/16/unity-for-playstation4-is-here/

What PS4 features are available?

Unity for PlayStation®4 brings support for powerful next-generation technologies such as Shader > Model 5 and compute shaders, allowing developers to create truly stunning visuals. What’s more, > we already have support for all the DUALSHOCK®4 features, including accessing each controller’s > individual speaker, touchpad, vibration, and light color.

From what I've found out about the Apple TV Remote is that it does not favour touch area to screen mapping. Whatever you're doing, I guess you'll have to deal with delta movement of the swipe gestures.

Comment
Add comment · Show 1 · 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
avatar image demonpants · Jan 25, 2016 at 04:15 PM 0
Share

Yeah, I guess that might be it. $$anonymous$$inda dumb, since the user experience would be significantly better if I could make this work right. But it does look like Apple simply doesn't want you to do that. The positions being reported by my touches seem to be kind of variable (the same spot on the touch pad is not giving me a consistent position). Oh well...

avatar image
1

Answer by Mantas-Puida · Jan 25, 2016 at 08:37 PM

Apple does not provide API to get absolute touch values from TV Remote touch area. Though there is work around for that: 1) put TV Remote analog input to absolute values: UnityEngine.Apple.TV.Remote.reportAbsoluteDpadValues = true;

2) scale analog input to resolution you want:

 if (Input.touchCount > 0)
 {
     float x = Input.GetAxis("Horizontal") * 800.0f; // Replace 800.0f with any number you like
     float y = Input.GetAxis("Vertical") * 800.0f;
  // Do something with x and y
 }


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

44 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I have a uniform struct in a Shader? 0 Answers

Differentiate between types of key press 1 Answer

How do you detect if a touch is hitting an object? 0 Answers

HELLPPPPP!!!! 0 Answers

The equivalent way of Input.GetKeyDown() in new input system 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