Building for the new AppleTV / tvOS

Thanks for your work, could you help me with this? Im running elvman test app but Im not getting any touch events.

Try calling startDiscoveryController in your first scene. I had same problem and this fixed it.

@ricardo will the tvOS support be added to cocos2dx v3.10, i really need this!

@b12345
v3.10 no, but most probably 3.11.

2 Likes

@ricardo Thanks, ill be definitely looking forward to that. :smile:

Thanks, I tried but no luck.

Edit:
Man someone should have replyed that touches were disabled on elvman’s cocos2d 3.9 … just check
CCEAGLView-tvos.mm, all that should have been under #pragma mark CCEAGLView - Touch Delegate is deleted.

Just use hawkwood’s 3.8 or copy the touches methods from CCEAGLView-tvos.mm

@ricardo
I tried to build using by current v3 branch, that is cocos2d / cocos2d-x, cocos2d / cocos2d-x-3rd-party-libs-bin.
But I got errors there is “no CoreMotion.Framework” on building to real machine.(deploy to AppleTV)
I want to deploy to real machine.
Can I build and deploy to real machine, not simulator?

yep, thanks for reporting it. I’ll take a look at this later. Kind of busy with other stuff at the moment.

@netunlimited, @elvman do you have gamepad support with your solution to quitting the app via the menu button working? My RootViewController is a GCEventViewController instead of the standard UIViewController, so my app doesn’t quit.

btw. how do you access the canExitApp variable from your coocs2d-x code?

I run this cocos2dx-helloword on tvos successful,but I find all of the label use the system font is black,setTextColor or setColor is useless,If evenryone know what’s wrong is it?@netunlimited, @elvman

@digitalhoax If by gamepad you mean using “Controller::startDiscoveryController()” and so on, then yes, it works. I use this to check if the “main” button or play/pause button is pressed (== menu button selected).

I don’t need to access the canExitApp variable from cocos2d-x, I use NDKHelper to call from c++ a method in AppController to change canExitApp.

@kavenGw Are you using a TTF font file for your labels? If so, check if it’s included in the Xcode tv target.

congrats to 3.10 :wink: Do you think that the tvos support will go to 3.11?

1 Like

yes.

@ShunLin any objection in adding TVos support for v3.11?

Will this include also JS support thus compiling SpiderMonkey with bitcode support?
More at: Help with compiling SpiderMonkey for tvOS
Thanks :wink:

if we add support of tvos, it will include all the needed libraries compiled with bitcode support.

1 Like

Hi guys, I still experience an issue when trying to build on my apple tv. During link phase I get “building for tvOS, but linking in object file built for iOS, for architecture arm64”
Does somebody has any idea?

Did not find an issue to add this: When someone adds support for the Apple TV remote will he please add support for controller.motion.userAcceleration and controller.motion.gravity? Thanks!

Our app has finally been approved for tvOS, only three month short of the initial schedule:

https://itunes.apple.com/us/app/comet-tail/id1068440823?ls=1&mt=8

We used @elvman 's fork, thanks a lot!

1 Like

Sorry to hijack this thread, but it turned up when googling for cocos2d-x and prebuilt libs and bitcode. I normally use my prebuilt cocos2d-x libs when developing games. Now I figure I should start using bitcode libs. Will I run into any problems?