In this recipe we will look into how to deal with touch events.
In PSM Studio, create a new project and add a reference to Sce.PlayStation.GameEngine2D
and Sce.PlayStation.GameEngine2D.Base
. Then add an image file to your project (I will re-use the trusty F18
) and make sure its Build Action is set to Content. The full code for this recipe is available as Ch2_Example4
.
This example will run in the simulator; however, it does not currently support multitouch. To see multiple touches handled, you will need to run this code on an actual device.
Open AppMain.cs
and 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_Example4 { public class AppMain { public static void Main...