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.
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:
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.
Apple does not provide API to get absolute touch values from TV Remote touch area. Though there is work around for that:
-
put TV Remote analog input to absolute values:
UnityEngine.Apple.TV.Remote.reportAbsoluteDpadValues = true;
-
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
}