PNG image cut off when loading sprite.

Ok, I’m going to post the entirety of my code here, even though I don’t believe that’s the problem. I’ve got only two classes, Game1.cs and Sprite.cs. They are posted in that order below. All I’m trying to do is load a sprite. I don’t know why it’s not working, but I think the problems lies with the pipeline tool. I tried another PNG and it worked fine. I’ve also tried reinstalling, but it seems to make no difference.

This is what it’s supposed to look like. This is also what it looks like if I click view INSIDE the monogame pipeline.

This is what it always ends up looking like.

I briefly got it to look like this after deleting the PNG, remaking it… AND THEN reloading it into the pipeline tool.Doing that again has only ever resulted in the second image.

GAME1.CS

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace AvoidTheStroids
{

public class Game1 : Game
{
    GraphicsDeviceManager graphics;
    SpriteBatch spriteBatch;
    private Texture2D texture;
    private Vector2 position;
    private Sprite sprite;
    public Game1()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
    }
    protected override void Initialize()
    {
        base.Initialize();
    }
    protected override void LoadContent()
    {
        
        spriteBatch = new SpriteBatch(GraphicsDevice);
        texture = Content.Load<Texture2D>("avoider");
        sprite = new Sprite(texture)
        {
            Position = new Vector2(0, 100),
        };
    }
    protected override void UnloadContent()
    {
    }
    protected override void Update(GameTime gameTime)
    {
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            Exit();
        base.Update(gameTime);
    }
    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.Black);
        spriteBatch.Begin();
        sprite.Draw(spriteBatch);
        spriteBatch.End();
        base.Draw(gameTime);
    }
}

}

SPRITE.CS

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AvoidTheStroids
{
class Sprite
{
private Texture2D _texture;
public Vector2 Position;

    public Sprite(Texture2D texture)
    {
        _texture = texture;
    }
    public void Draw(SpriteBatch spriteBatch)
    {
        spriteBatch.Draw(
            _texture,
            Position,
            Color.White);
    }
}

}

The texture processor used by the pipeline tool supports making a specific color transparent. I think that’s what’s happening here because the default color is pure magenta (255, 0, 255), which looks like the color of your missing pixels. Check the processor settings in the pipeline tool and make sure you disable this feature.

1 Like

I don’t see any “processor settings”. Am I crazy?

Nevermind, found it. I figured something like this was probably the case shortly after I posted this. I still can’t explain how the top showed up one of those times, but I guess I don’t really care. Thank you.

1 Like