Manipulating a texture's pixels
In this recipe, we are going to modify a sprite by working with its pixel data directly. We are going to perform two actions on the image. First we are going to increase the transparency of every solid pixel in the image. Then we are going to surround the image with a red rectangle, as you might put around a selected character sprite or button.
Create a new solution, add a reference to GameEngine2D, and add a sprite object. Once again I am going to use
FA-18H.png. The source for this project is available as
How to do it...
AppMain.csreplace the existing code with the following code:
using System; using System.Collections.Generic; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Graphics; ...