In this recipe, we are going to create a sprite and add it to a scene, rendering it centered on the screen .
Create a new project and add a reference to GameEngine2D. You are going to need to add an image file to use as a sprite; I will be reusing our trusty F18
graphic. The complete source for this example can be found in Ch3_Example3
.
Open
AppMain.cs
and add 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 Ch3_Example3 { public class AppMain { public static void Main (string[] args) { Director.Initialize(); Scene scene = new Scene(); scene.Camera.SetViewFromViewport(); TextureInfo ti = new TextureInfo("/Application/FA-18h...