zoukankan      html  css  js  c++  java
  • About Game Controllers

    About Game Controllers

      Game Controller(GC),框架从iOS 7和OS X v10.9开始加入,用于便捷使用控制器(手柄). Once discovered, your game reads control inputs as part of its normal gameplay. There are three kinds of controllers available:

    • A standard form-fitting controller: An iOS device sits inside the controller and the player can access both the iOS device’s screen and the controller elements.
    • An extended form-fitting controller: An iOS device sits inside the controller and the player can access both the iOS device’s screen and the controller elements.
    • An extended wireless controller: A controller that wirelessly connects to an iOS device or Mac.

      在使用GC的时候,须把GC设为可选,即游戏没有手柄,也要能玩。GC的主要类是GCController,通过以下2方法来管理无线手柄的同步:

      

      When designing your game, you can use one of the following strategies to read the profile’s input elements:

    • In your game loop, poll the values of the elements you are interested in. Reading an input directly works best for elements that need to be read every frame, such as directional pads. (每帧读取
    • Register a block to be called when values change. You can choose to register a block for a single element or for all of the elements in the profile. Callbacks work best when you need to guarantee that a change is always detected. (设置回调读取
    • Periodically save a snapshot of the controller state. All of the controls are read simultaneously. Then, at a later point in the game, the controller data is processed.(保存完整profile数据,之后读取

     

  • 相关阅读:
    使用TortoiseGit从GitHub下拉上传代码配置
    Git 安装和使用教程(转载)
    C++的STL之map自动排序特性
    C语言实现随机生成0~100的数
    C语言实现随机生成0或1
    和 区别
    C语言文件操作函数
    php的缓冲/缓存 js对象 ,php编程的深入思考-1
    apache安装时的一些术语
    在linux下手动安装 apache, php, mysql--终极版
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3666525.html
Copyright © 2011-2022 走看看