Skip to content

2D materials #2408

Answered by MikDal002
MikDal002 asked this question in Newcomers
Discussion options

You must be logged in to vote

Ok, after many hours, I've already figured it out. I would like to leave it here for others who will be looking for it.

Code preparation

As documentation (https://doc.stride3d.net/4.2/en/manual/graphics/low-level-api/spritebatch.html) states at the top you need a custom ScreenRenderer. Unfortunately none is presented in docs, so I share mine with you below called UglyRendererScript. Just write this as a script.

public class UglyRendererScript : SceneRendererBase
{
    /// <summary>
    /// Virtual space where we will be drawing. I've made it a little smaller for my "pixelart".
    /// </summary>
    private readonly Vector2 _virtualResolution = new Vector2(1920/2, 1080/2);

    private Sp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MikDal002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant