I am very sorry, but looking at the samples, I understand absolutely nothing. And the documentation is not helpful if one wants to get started.
To learn the basics, I want to create a very simple game: A sprite character that I can move left and right.
So I created a new Game, added a SpriteGroup in the Assets folder and added one line of code according to this document. My code now looks like this:
using System.Threading.Tasks;
using SiliconStudio.Core.Mathematics;
using SiliconStudio.Paradox;
using SiliconStudio.Paradox.Effects;
using SiliconStudio.Paradox.Graphics;
namespace SpriteAndBackground
{
public class SpriteAndBackgroundGame : Game
{
public SpriteAndBackgroundGame()
{
// Target 9.1 profile by default
GraphicsDeviceManager.PreferredGraphicsProfile = new[] { GraphicsProfile.Level_9_1 };
}
protected override async Task LoadContent()
{
await base.LoadContent();
CreatePipeline();
// Add custom game init at load time here
var megaman = Asset.Load<SpriteGroup>("megaman");
// Add a custom script
Script.Add(GameScript1);
}
private void CreatePipeline()
{
// Setup the default rendering pipeline
RenderSystem.Pipeline.Renderers.Add(new CameraSetter(Services));
RenderSystem.Pipeline.Renderers.Add(new RenderTargetSetter(Services) { ClearColor = Color.CornflowerBlue });
RenderSystem.Pipeline.Renderers.Add(new ModelRenderer(Services, "SpriteAndBackgroundEffectMain"));
RenderSystem.Pipeline.Renderers.Add(new UIRenderer(Services));
}
private async Task GameScript1()
{
while (IsRunning)
{
// Wait next rendering frame
await Script.NextFrame();
// Add custom code to run every frame here (move entity...etc.)
// ...
}
}
}
}
I was expecting to see the SpriteGroup, but I only see a blue background. So, how do I display the SpriteGroup?