In this recipe we will look at integrating the UI library with a GameEngine2D project. In the process we will demonstrate adding and handling a Button
widget.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.HighLevel.UI
and Sce.PlayStation.HighLevel.GameEngine2D
. Additionally, we will be drawing a 960 x 544 (the Vita's native resolution) SpriteUV
using the image beach.png
; of course you can substitute your own. The entire project including images is available in Ch6_Example2
.
Open AppMain.cs
and change the existing code to 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; using Sce.PlayStation.HighLevel.UI; namespace...