Hello people!!!!!!! I'm a new member of this great community! But i'm a noob with XNA :( I've a question to do for you...
Then, there is this source:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace tutorial_XNA
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D imm_folletto;
Vector2 posizione;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
posizione = new Vector2(0f, 0f);
base.Initialize();
}
protected override void LoadContent()
{
imm_folletto = Content.Load<Texture2D>("Immagini/folletto");
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);
spriteBatch.Draw(imm_folletto, posizione, Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
}
}
Well, it put on the screen the image "folletto". And this is it main source where is the Main():
http://www.wilez.it/tutorials/XNA/immagini/main_XNA1.gif
My question is: in main source the object game is created on the class Game1 that in the other source. Well, there is the builder(or maker(i'm not english ;)) that has:
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
and then the object game has the object graphics and Content.RootDirectory = "Content";.
I don't understand how the metods (or function of the class) will be used by the object " game" in the main source becouse i don't see anywhere where they are called but the programs go well...
Please, help me! Are 2 days that i don't understand this...