Inserting Content Help

Hello

I am brand new to monogame and I'm having issues with the loading of content on to the game. I'm using the doc's tutorial on loading thins in and I can't load in the ball.png. I did exactly what it said in the tutorial and my window looks like this:

not

Besides the fact that the windows are different because I’m working on my PC, but the concern is that the ball.png texture isn’t at the edge of the window.

It can be either

  • That the (0,0) position I assigned the ball to be located talks about the (0,0) of the resolution of my screen
  • That because I changed the game1.cs file into theWorld.cs and changed everything game to theWorld(which could've f***ed it all up)
  • or
  • That it somehow makes the texture transparent 0-0
I'm having issues and I'd love it for the help. also I am a C/C++ person and not a C# person tnx.

Here is the drawing code

protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();

        // TODO: Add your update logic here
        spriteBatch.Begin();
        spriteBatch.Draw(textureBall, new Vector2(0, 0), Color.Black);
        spriteBatch.End();

        base.Update(gameTime);
    }

Welcome to MonoGame! Can you post your draw code? Changing the name of Game1.cs is fine and won’t cause any issues.

1 Like

Alright. The code should be there now. sorry if it’s messy to read because of formatting

It looks like your code for drawing the ball is in Update instead of Draw. The reason you don’t see anything is because you’re drawing to the screen, then the first line in Draw - GraphicsDevice.Clear(Color.CornflowerBlue); - clears the screen with a CornflowerBlue color.

Place your draw code after that line in Draw and you should see the ball.

OOOOOOH okay thanks. I’ll put the code into the draw function