In this recipe, we will look at how to read the device's gamepad's d-pad and button states. The code remains the same regardless of whether it is a physical device or if the controls are emulated.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.GameEngine2D
and Sce.PlayStation.GameEngine2D.Base
. The complete source for this example can be found in Ch2_Example1
.
In the AppMain.cs
file of your newly created project, enter the following code:
using System; using System.Collections.Generic; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Environment; using Sce.PlayStation.Core.Graphics; using Sce.PlayStation.Core.Input; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; namespace Ch2_Example1 { public class AppMain { public static void Main (string[] args) { Director.Initialize(); Scene scene = new...