Camera Settings in the Pinball Games iOS and tvOS Starter Kit

Camera Settings in the Pinball Games iOS and tvOS Starter Kit

Every one of your table scenes, (.sks files) should include a Camera named TheCamera. You can simply copy it in from any of the demo files (or drag it in from the Media Library).  The camera is always the same size as the scene, but you can adjust the zoom via the property list to give it two values: one for normal gameplay with a single ball in play, or the zoom for “multi-ball” mode when more than one ball is in play.

SKCameraNode

The camera can also follow / track the ball when a single ball is in play. The camera can track horizontally or vertically. By default the kit tracks the ball vertically but not horizontally.

Camera Settings Dictionary

The CameraSettings dictionary within the table dictionary is used override default properties related to the camera, zoom, tracking, and some other settings. We recommend copying the demo table’s CameraSettings dictionary then editing those to get a feel for the changes. Since the camera is an important part of perfecting the table view the settings will vary on the iPhone, iPad and especially TV. So most of the settings below are device specific, meaning you should include TV, Pad or Phone after the base property name. In no particular order…

  • CameraFollowsBallX – (default is NO). Setting YES will make the camera track the ball horizontally (on the x axis)
  • CameraFollowsBallY – (default is YES). Setting this to NO will stop the camera from following the ball vertically (on the y axis)
  • CameraMaxTV – (TV app only property) The highest point on the y axis the camera can follow the ball.  So if the ball goes over this value, the camera stops following it. By default this value is 1.5 times the scene height.
  • CameraMinTV – (TV app only property)  The lowest point on the y axis the camera can follow the ball. So if the ball below this value, the camera stops follow it. In other words, the camera won’t go lower than the table artwork. By default this value is half the scene height.
  • CameraMaxPhone –  (iPhone app only property) see above for details.
  • CameraMinPhone –  (iPhone app only property)  see above for details.
  • CameraMaxPad – (iPad app only property)  see above for details.
  • CameraMinPad – (iPad app only property)  see above for details.
  • CameraZoomTV – (TV app only property)  a decimal value for the zoom of the camera when only one ball is in play.
  • CameraZoomForMultiBallTV – (TV app only property)  a decimal value for the zoom of the camera when more than one ball is in play.
  • CameraZoomPhone – (iPhone app only property)  see above for details.
  • CameraZoomForMultiBallPhone – (iPhone app only property)  see above for details.
  • CameraZoomPad – (iPad app only property) see above for details.
  • CameraZoomForMultiBallPad – (iPad app only property)  see above for details.
  • CameraYLocationDuringMultiBallTV – (default is -123456 which makes the kit ignore it, TV app only property) Setting this to any number value will move and keep the camera at this Y location during multi ball mode. This is used to make sure the table goes down (or maybe up)  while zooming out for multi ball mode. Although by default this variable is ignored, we’ve included entries in the property list of the demo table which should be suited for most tables.
  • CameraYLocationDuringMultiBallPhone – (default is -123456 which makes the kit ignore it, iPhone app only property)  see above for details.
  • CameraYLocationDuringMultiBallPad – (default is -123456 which makes the kit ignore it, iPad app only property)  see above for details.
  • HideAllCameraNodesTV – (default is NO, TV app only property) Setting this to YES will hide any children inside of the Camera (except Buttons which are normally hidden during gameplay). You might do this to create a more purist, GUI-less table. Great property for making alternate versions of tables.
  • HideAllCameraNodesPhone – (default is NO, iPhone app only property) see above for details.
  • HideAllCameraNodesPad – (default is NO, iPad app only property)  see above for details.
Continue reading about Label Settings