want to know how to pass a random number to text to be displayed
could anyone tell me what im doing wrong here?
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
SpriteFont font;
Rectangle spriterect;
int roll = 0;
public Game1()
{
graphics =
new GraphicsDeviceManager(this);
Content.RootDirectory =
"Content";
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
spriterect =
new Rectangle(30, 20, 600, 450);
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch =
new SpriteBatch(GraphicsDevice);
font = Content.Load<
SpriteFont>("Kootenay");
// TODO: use this.Content to load your game content here
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
Random dieroll = new Random();
int d4 = 4;
int d6 = 6;
int d8 = 8;
int d10 = 10;
int d12 = 12;
int d20 = 20;
// Allows the game to exit
if(GamePad.GetState(PlayerIndex.One).Buttons.A == ButtonState.Pressed)
{
d4 = dieroll.Next(1,d4+1);
d4 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.B== ButtonState.Pressed)
{
d6 = dieroll.Next(1, d6 + 1);
d6 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.X== ButtonState.Pressed)
{
d8 = dieroll.Next(1, d8 + 1);
d8 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.Y == ButtonState.Pressed)
{
d10 = dieroll.Next(1, d10 + 1);
d10 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.LeftShoulder == ButtonState.Pressed)
{
d12 = dieroll.Next(1, d12 + 1);
d12 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.RightShoulder == ButtonState.Pressed)
{
d20 = dieroll.Next(1, d20 + 1);
d20 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
Vector2 text = new Vector2(200, 300);
GraphicsDevice.Clear(
Color.CornflowerBlue);
spriteBatch.DrawString(font, roll.ToString, spriterect.X, spriterect.Y,
Color.Black);
// TODO: Add your drawing code here
base.Draw(gameTime);
}
}
}
i just want to make a simple d and d dice roller for marketplace, any help would be great
want to know how to pass a random number to text to be displayed
could anyone tell me what im doing wrong here?
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
SpriteFont font;
Rectangle spriterect;
int roll = 0;
public Game1()
{
graphics =
new GraphicsDeviceManager(this);
Content.RootDirectory =
"Content";
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
spriterect =
new Rectangle(30, 20, 600, 450);
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch =
new SpriteBatch(GraphicsDevice);
font = Content.Load<
SpriteFont>("Kootenay");
// TODO: use this.Content to load your game content here
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
Random dieroll = new Random();
int d4 = 4;
int d6 = 6;
int d8 = 8;
int d10 = 10;
int d12 = 12;
int d20 = 20;
// Allows the game to exit
if(GamePad.GetState(PlayerIndex.One).Buttons.A == ButtonState.Pressed)
{
d4 = dieroll.Next(1,d4+1);
d4 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.B== ButtonState.Pressed)
{
d6 = dieroll.Next(1, d6 + 1);
d6 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.X== ButtonState.Pressed)
{
d8 = dieroll.Next(1, d8 + 1);
d8 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.Y == ButtonState.Pressed)
{
d10 = dieroll.Next(1, d10 + 1);
d10 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.LeftShoulder == ButtonState.Pressed)
{
d12 = dieroll.Next(1, d12 + 1);
d12 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.RightShoulder == ButtonState.Pressed)
{
d20 = dieroll.Next(1, d20 + 1);
d20 = roll;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
Vector2 text = new Vector2(200, 300);
GraphicsDevice.Clear(
Color.CornflowerBlue);
spriteBatch.DrawString(font, roll.ToString, spriterect.X, spriterect.Y,
Color.Black);
// TODO: Add your drawing code here
base.Draw(gameTime);
}
}
}
i just want to make a simple d and d dice roller for marketplace, any help would be great
"Index was outside the bounds of the array."
I'm trying to read a text file and store it into an array, then draw a map according to the contents of the file. The file contents are:
| 1 | public void InitializeReadMaps(int map) // this is just run once, it's just a test |
| 2 | { |
| 3 | this.FileName = "map" + map.ToString() + ".txt"; |
| 4 | this.file = new FileStream(this.FileName, FileMode.Open, FileAccess.Read); |
| 5 | this.sr = new StreamReader(this.file); |
| 6 | string line = this.sr.ReadLine(); |
| 7 | this.YLength = Int32.Parse(line); |
| 8 | this.XLength = Int32.Parse(line); |
| 9 | this.map = new char[this.XLength, this.YLength]; |
| 10 | } |
| 11 | |
| 12 | public void ReadMaps() |
| 13 | { |
| 14 | if (!sr.EndOfStream) |
| 15 | { |
| 16 | for (int y = 0; y < (this.YLength - 1); y++) |
| 17 | { |
| 18 | string line = this.sr.ReadLine(); |
| 19 | for (int x = 0; x < (this.XLength - 1); x++) |
| 20 | { |
| 21 | map[x, y] = line[x]; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | public void DrawContent(SpriteBatch spriteBatch) |
| 28 | { |
| 29 | for(int y = 0; y < this.YLength; y++) |
| 30 | { |
| 31 | for (int x = 0; x < this.XLength; x++) |
| 32 | { |
| 33 | switch (this.map[x,y]) |
| 34 | { |
| 35 | case '1': tile.DrawTile(spriteBatch, x, y, 1); break; |
| 36 | case '2': tile.DrawTile(spriteBatch, x, y, 2); break; |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
| map[x, y] = line[x]; |
"Index was outside the bounds of the array."
I'm trying to read a text file and store it into an array, then draw a map according to the contents of the file. The file contents are:
| 1 | public void InitializeReadMaps(int map) // this is just run once, it's just a test |
| 2 | { |
| 3 | this.FileName = "map" + map.ToString() + ".txt"; |
| 4 | this.file = new FileStream(this.FileName, FileMode.Open, FileAccess.Read); |
| 5 | this.sr = new StreamReader(this.file); |
| 6 | string line = this.sr.ReadLine(); |
| 7 | this.YLength = Int32.Parse(line); |
| 8 | this.XLength = Int32.Parse(line); |
| 9 | this.map = new char[this.XLength, this.YLength]; |
| 10 | } |
| 11 | |
| 12 | public void ReadMaps() |
| 13 | { |
| 14 | if (!sr.EndOfStream) |
| 15 | { |
| 16 | for (int y = 0; y < (this.YLength - 1); y++) |
| 17 | { |
| 18 | string line = this.sr.ReadLine(); |
| 19 | for (int x = 0; x < (this.XLength - 1); x++) |
| 20 | { |
| 21 | map[x, y] = line[x]; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | public void DrawContent(SpriteBatch spriteBatch) |
| 28 | { |
| 29 | for(int y = 0; y < this.YLength; y++) |
| 30 | { |
| 31 | for (int x = 0; x < this.XLength; x++) |
| 32 | { |
| 33 | switch (this.map[x,y]) |
| 34 | { |
| 35 | case '1': tile.DrawTile(spriteBatch, x, y, 1); break; |
| 36 | case '2': tile.DrawTile(spriteBatch, x, y, 2); break; |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
| map[x, y] = line[x]; |
17 Again (Blu-ray/DVD Combo + Digital Copy) [Blu-ray] (Blu-ray) newly tagged "blu-ray"
First tagged “blu-ray” by Armchair Commentary “Amazon.com Movies & TV Editors”
Customer tags: blu-ray(2), high definition, 17 again, digital copy, zac efron, high school musical troy, matthew perry
Michael Jackson: The Music And The Money
Read MoreWatchmen (Director’s Cut) (Two-Disc Special Edition + Amazon Digital Bundle + Digital Copy) (DVD) newly tagged "blu-ray"
Watchmen (Director’s Cut) (Two-Disc Special Edition + Amazon Digital Bundle + Digital Copy) (DVD)
By Matt Frewer
First tagged “blu-ray” by S. Chi
Customer tags: watchmen(10), superhero(9), alternate history(7), alan moore(7), dave gibbons(6), adventure(4), comics(4), animated(3), digital copy(3), action(3), billy crudup, 300
CodePlex Daily Summary for Thursday, July 02, 2009
CodePlex Daily Summary for Thursday, July 02, 2009
New Projects
- NerdDinner(VB): 在看《ASP.Net MVC Step By Step》一书,决定把书上的NerdDinner项目用VB2010写一遍,借个地方放代码:)
- Jac Silverlight Game Server: This is a silverlight games service project. Contains server and client code souce and demo.
- Salient.MapIconSetMaker: A wrapper for google MapIconMaker. Dynamically generate sets of fully populated GIcon objects for use with Google Maps API. Includes a jQuery plug…
- Silverlight Templates: Silverlight 3 templates that can be used with Blogger.com
- JacDigitalDrum: Here is a computer digital Drum kit's softwear. Hardwear use arduino.
- Cultiv Contact Form: The Cultiv Contact Form package allows you to quickly get a basic contact form in your Umbraco website.
- JacArdSL: arduino comunication to silverlight
- TE: This is to convert a global site of teleeye to .net.
- YouTube API for ASP.NET: YouTube API for ASP.NET, AJAX-extended
- Reflex: Reflex is a collection of tools, utilities and helpers methods for manipulating data via System.Reflection Reflex enable you to easily transform …
- Sword of the Stars Calculator: The SotS Calculator is aimed at making quick decisions on whether or not to colonize that high CH planet. You can pick a race, appropriate techs, a…
- MVC & jquery: Give me one more js framework? No, jquery is enough.
- Umbraco Examine: Umbraco Examine is a powerful, fully configurable, and extensible library used for indexing Umbraco content to allow for fast and easy content sear…
- upabibo-lib: Library management. This project is developed by Upabibo Hoang Anh Tran.
- Single Sign On - Light Weight: Single Sign On (SSO) solution for cross domain sites which do not share cookies, session ids etc. Built using WCF Service. A Silverlight based sit…
- TwiLite: A twitter API and client. TwiLite (Twitter Lite) has three goals: 1. Maximum Speed, both of user interface and API 2. Minimum system resource …
New Releases
- MediaPlayerCS 2.0 by ekleeman.com: MediaPlayerCS 2.0: ! MediaPlayerCS 2.0 Release !! New Faetures! *MediaPlayerCS Skin* *Catalog of Gallerys Function* *XML based Catalog of Gallerys setup file make…
- DotNetNuke® WebControls: v02.01.01.61 - Nightly: This is a *Nightly Build*! No testing has been done with it. Use at your own risk! For a list of fixes included in this release go to [url:this …
- Exception Handling WCF Proxy Generator: ExceptionHandlingWCFProxyGenerator Add-In Source: This release includes the source code for the ExceptionHandlingWCFProxyGenerator Add-In including the latest version as of this date of the Excepti…
- Hineini: 0.6.43: Hineini tells Yahoo's Fire Eagle service where you are. New in this version… * Improved: environment data logging
- Salient.MapIconSetMaker: Standard JS and jQuery Plugin (1.2): Wrapped the jQuery demo into a plugin. fixed a porting bug.
- Reflex: Reflex 1.0: First release with basic dictionary mapping/transforms support. Including a Silverlight 2.0 runtime (Reflex.Ag).
- DocX: DocX v1.0.0.5: DocX v1.0.0.5 is a huge update. A lot has changed under the covers for this release. Lots of new functionality has been added also. Highlights 1) …
- HTML Editor for ASP.NET AJAX: Release 1.9.5: This is the *Basic Edition* release: * HtmlEditor.VS2008.zip targets Visual Studio 2008 and ASP.NET 3.5 * HtmlEditor.VS2005.zip targets Visual Stud…
- StickyTweets: 0.5.1: ! Version 0.5.1 * Twitter - Request more tweets since last ID (so you miss fewer overnight tweets on a closed laptop) * Life - Move to a new apart…
- Minima Blog Engine (training software): Minima 3.3 - Built on Themelia Pro 2.0 and WCF:
- VPC Manager: Version 0.3.3: The application supports all basic functions now: * Scanning several folder * Reset MAC address * Starting machines * Sorting the list of machines …
- SharePoint Property Bag Settings: PropertyBagSettings.wsp: ! Property Bag Settings Solution *The properties are (now) displayed in a sorted format* A WSP (Solution Package) which contains one feature whic…
- DirectQ: Release 1.6.3: Latest DirectQ release; this supersedes 1.6.2 which will be removed in about a weeks time. No new eye-candy for you, this is entirely bug-fixes an…
- Find Files utility: KMPSearcher BETA: This BETA release of the KMPSearcher utility now contains an indexing framework written in .NET that one can use to build an index of all files on …
- YouTube API for ASP.NET: YouTube_API: YouTube API for ASP.NET, AJAX-extended, Beta release
- EPiServer CMS Page Type Builder: Page Type Builder 0.7.2: This release contains two important bug fixes for the GetPropertyValue and SetPropertyValue methods that would throw an exception when the requeste…
- JacDigitalDrum: jacDigitalDrum1.0.0: 1:把arduino code souce烧到阁下的arduino板。 (六个analog in的每个使用一个钳位电路【1m电阻,5.1v稳压二极管】,然后连到一个压电陶瓷) 2.安装jacDigitalDrum for windows. (运行setup.exe) 3.wav files…
- Windows Service Manager Tray: ServiceManagerTray v0.9.3469.32344: Added distribution info. Added manifast for Vist UAC. Fixed assembly info. Fixed alt+tab functionality. Fixed tool window bug. Window still shows u…
- Windows Live Writer Backup: Version 3.0.0.5: This update resolves a big issue people have been having with restoring.
- workflow designer based on silverlight: ShareDesigner2.0: a workflow designer developed in silverlight . you can visit [url:http://www.shareidea.net/opensource.htm] for more information.
- JacArdSL: jacArdsl Poxy: arduino comunication to silverlight.
- Jac Silverlight Game Server: jacSLGameServer: This release is contais server and client code source and a demo.
- Cultiv Contact Form: Cultiv Contact Form v0.8.0: The Cultiv Contact Form package allows you to quickly get a basic contact form in your website. The form will ask your website visitor for a name…
- Charting for SharePoint (by Prexens): 1.0: {project:description} _*Note to 1.0 RC2 users:* Version 1.0 RC2 will expire on 1 Oct. 2009. Version 1.0 has no expiry._ *1.0* * Area chart suppor…
- Silverlight Templates: Silverlight Templates: Source code of the site silverlight3.in
- Salient.MapIconSetMaker: Initial Release: First release.
- NM-02 Volume Maximizer: NM-02 Version 2.0.0.9: Subregion gain interpolation (Cubic-Hermite Spline)
- Pex Extensions: Automated Software Engineering Group@NCSU: Fitnex 1.0: Installing Fitnex: 1. Download latest Pex release (v0.14.40610.2, 06/11/2009) from [here|url:http://research.microsoft.com/en-us/projects/pex/down…
- SensorWpf: SensorWpf v2009.07.01 (chgset 26034): First public release of the SensorWpf encapsulatoin + Tron7 source code. Zip contains source from changeset 26034.
- Xcoordination Application Space: AppSpace Usage Demos for CTP 4: Updated short demos for many features of the Application Space. The download now contains all binaries of 3rd party libraries. Just download, unzip…
- Xcoordination Application Space: AppSpace CTP 4: This release finally contains all binaries of 3rd party libraries. By downloading this release installing the AppSpace has become a one stop "setup…
- PHP SDK for Windows Azure: PHPAzure CTP2 (0.2.0): *INSTALLATION* —- PHP SDK for Windows Azure requires no special installation steps. Simply download the SDK, extract it to the folder you would …
- NetSqlAzMan - .NET SQL Authorization Manager: 3.6.0.2: [IMPORTANT ! Read here before upgrading NetSqlAzMan to version 3.6.0.0 or later] 3.6.0.2 1-July-2009 - Fix: StorageCache build error for empty "LD…
- VCC: Latest build, v2.1.20701.0: Latest build
- IIS Log Analyzer: Release Indihiang 0.2: For installation and how to use, please read Indihiang portal: [url:http://indihiang.aguskurniawan.net] What's New in Indihiang 0.2 ? check [url:…
Most Popular Projects
- Rawr
- AJAX Control Toolkit
- WBFS Manager
- Windows Presentation Foundation (WPF)
- Silverlight Toolkit
- Google Book Downloader
- Microsoft SQL Server Product Samples: Database
- ASP.NET
- DotNetNuke® Community Edition
- Microsoft SQL Server Community & Samples
Most Active Projects
- Rawr
- Farseer Physics Engine
- Windows Presentation Foundation (WPF)
- DotNetZip Library
- patterns & practices SharePoint Guidance
- patterns & practices – Enterprise Library
- Perspective FX : a ShaderEffect generator for WPF and Silverlight
- PHPExcel - OpenXML - Create Excel2007 documents in PHP - Spreadsheet engine
- BlogEngine.NET
- NB_Store - Free DotNetNuke Ecommerce Catalog Module
CodePlex Daily Summary for Thursday, July 02, 2009
CodePlex Daily Summary for Thursday, July 02, 2009
New Projects
- NerdDinner(VB): 在看《ASP.Net MVC Step By Step》一书,决定把书上的NerdDinner项目用VB2010写一遍,借个地方放代码:)
- Jac Silverlight Game Server: This is a silverlight games service project. Contains server and client code souce and demo.
- Salient.MapIconSetMaker: A wrapper for google MapIconMaker. Dynamically generate sets of fully populated GIcon objects for use with Google Maps API. Includes a jQuery plug…
- Silverlight Templates: Silverlight 3 templates that can be used with Blogger.com
- JacDigitalDrum: Here is a computer digital Drum kit's softwear. Hardwear use arduino.
- Cultiv Contact Form: The Cultiv Contact Form package allows you to quickly get a basic contact form in your Umbraco website.
- JacArdSL: arduino comunication to silverlight
- TE: This is to convert a global site of teleeye to .net.
- YouTube API for ASP.NET: YouTube API for ASP.NET, AJAX-extended
- Reflex: Reflex is a collection of tools, utilities and helpers methods for manipulating data via System.Reflection Reflex enable you to easily transform …
- Sword of the Stars Calculator: The SotS Calculator is aimed at making quick decisions on whether or not to colonize that high CH planet. You can pick a race, appropriate techs, a…
- MVC & jquery: Give me one more js framework? No, jquery is enough.
- Umbraco Examine: Umbraco Examine is a powerful, fully configurable, and extensible library used for indexing Umbraco content to allow for fast and easy content sear…
- upabibo-lib: Library management. This project is developed by Upabibo Hoang Anh Tran.
- Single Sign On - Light Weight: Single Sign On (SSO) solution for cross domain sites which do not share cookies, session ids etc. Built using WCF Service. A Silverlight based sit…
- TwiLite: A twitter API and client. TwiLite (Twitter Lite) has three goals: 1. Maximum Speed, both of user interface and API 2. Minimum system resource …
New Releases
- MediaPlayerCS 2.0 by ekleeman.com: MediaPlayerCS 2.0: ! MediaPlayerCS 2.0 Release !! New Faetures! *MediaPlayerCS Skin* *Catalog of Gallerys Function* *XML based Catalog of Gallerys setup file make…
- DotNetNuke® WebControls: v02.01.01.61 - Nightly: This is a *Nightly Build*! No testing has been done with it. Use at your own risk! For a list of fixes included in this release go to [url:this …
- Exception Handling WCF Proxy Generator: ExceptionHandlingWCFProxyGenerator Add-In Source: This release includes the source code for the ExceptionHandlingWCFProxyGenerator Add-In including the latest version as of this date of the Excepti…
- Hineini: 0.6.43: Hineini tells Yahoo's Fire Eagle service where you are. New in this version… * Improved: environment data logging
- Salient.MapIconSetMaker: Standard JS and jQuery Plugin (1.2): Wrapped the jQuery demo into a plugin. fixed a porting bug.
- Reflex: Reflex 1.0: First release with basic dictionary mapping/transforms support. Including a Silverlight 2.0 runtime (Reflex.Ag).
- DocX: DocX v1.0.0.5: DocX v1.0.0.5 is a huge update. A lot has changed under the covers for this release. Lots of new functionality has been added also. Highlights 1) …
- HTML Editor for ASP.NET AJAX: Release 1.9.5: This is the *Basic Edition* release: * HtmlEditor.VS2008.zip targets Visual Studio 2008 and ASP.NET 3.5 * HtmlEditor.VS2005.zip targets Visual Stud…
- StickyTweets: 0.5.1: ! Version 0.5.1 * Twitter - Request more tweets since last ID (so you miss fewer overnight tweets on a closed laptop) * Life - Move to a new apart…
- Minima Blog Engine (training software): Minima 3.3 - Built on Themelia Pro 2.0 and WCF:
- VPC Manager: Version 0.3.3: The application supports all basic functions now: * Scanning several folder * Reset MAC address * Starting machines * Sorting the list of machines …
- SharePoint Property Bag Settings: PropertyBagSettings.wsp: ! Property Bag Settings Solution *The properties are (now) displayed in a sorted format* A WSP (Solution Package) which contains one feature whic…
- DirectQ: Release 1.6.3: Latest DirectQ release; this supersedes 1.6.2 which will be removed in about a weeks time. No new eye-candy for you, this is entirely bug-fixes an…
- Find Files utility: KMPSearcher BETA: This BETA release of the KMPSearcher utility now contains an indexing framework written in .NET that one can use to build an index of all files on …
- YouTube API for ASP.NET: YouTube_API: YouTube API for ASP.NET, AJAX-extended, Beta release
- EPiServer CMS Page Type Builder: Page Type Builder 0.7.2: This release contains two important bug fixes for the GetPropertyValue and SetPropertyValue methods that would throw an exception when the requeste…
- JacDigitalDrum: jacDigitalDrum1.0.0: 1:把arduino code souce烧到阁下的arduino板。 (六个analog in的每个使用一个钳位电路【1m电阻,5.1v稳压二极管】,然后连到一个压电陶瓷) 2.安装jacDigitalDrum for windows. (运行setup.exe) 3.wav files…
- Windows Service Manager Tray: ServiceManagerTray v0.9.3469.32344: Added distribution info. Added manifast for Vist UAC. Fixed assembly info. Fixed alt+tab functionality. Fixed tool window bug. Window still shows u…
- Windows Live Writer Backup: Version 3.0.0.5: This update resolves a big issue people have been having with restoring.
- workflow designer based on silverlight: ShareDesigner2.0: a workflow designer developed in silverlight . you can visit [url:http://www.shareidea.net/opensource.htm] for more information.
- JacArdSL: jacArdsl Poxy: arduino comunication to silverlight.
- Jac Silverlight Game Server: jacSLGameServer: This release is contais server and client code source and a demo.
- Cultiv Contact Form: Cultiv Contact Form v0.8.0: The Cultiv Contact Form package allows you to quickly get a basic contact form in your website. The form will ask your website visitor for a name…
- Charting for SharePoint (by Prexens): 1.0: {project:description} _*Note to 1.0 RC2 users:* Version 1.0 RC2 will expire on 1 Oct. 2009. Version 1.0 has no expiry._ *1.0* * Area chart suppor…
- Silverlight Templates: Silverlight Templates: Source code of the site silverlight3.in
- Salient.MapIconSetMaker: Initial Release: First release.
- NM-02 Volume Maximizer: NM-02 Version 2.0.0.9: Subregion gain interpolation (Cubic-Hermite Spline)
- Pex Extensions: Automated Software Engineering Group@NCSU: Fitnex 1.0: Installing Fitnex: 1. Download latest Pex release (v0.14.40610.2, 06/11/2009) from [here|url:http://research.microsoft.com/en-us/projects/pex/down…
- SensorWpf: SensorWpf v2009.07.01 (chgset 26034): First public release of the SensorWpf encapsulatoin + Tron7 source code. Zip contains source from changeset 26034.
- Xcoordination Application Space: AppSpace Usage Demos for CTP 4: Updated short demos for many features of the Application Space. The download now contains all binaries of 3rd party libraries. Just download, unzip…
- Xcoordination Application Space: AppSpace CTP 4: This release finally contains all binaries of 3rd party libraries. By downloading this release installing the AppSpace has become a one stop "setup…
- PHP SDK for Windows Azure: PHPAzure CTP2 (0.2.0): *INSTALLATION* —- PHP SDK for Windows Azure requires no special installation steps. Simply download the SDK, extract it to the folder you would …
- NetSqlAzMan - .NET SQL Authorization Manager: 3.6.0.2: [IMPORTANT ! Read here before upgrading NetSqlAzMan to version 3.6.0.0 or later] 3.6.0.2 1-July-2009 - Fix: StorageCache build error for empty "LD…
- VCC: Latest build, v2.1.20701.0: Latest build
- IIS Log Analyzer: Release Indihiang 0.2: For installation and how to use, please read Indihiang portal: [url:http://indihiang.aguskurniawan.net] What's New in Indihiang 0.2 ? check [url:…
Most Popular Projects
- Rawr
- AJAX Control Toolkit
- WBFS Manager
- Windows Presentation Foundation (WPF)
- Silverlight Toolkit
- Google Book Downloader
- Microsoft SQL Server Product Samples: Database
- ASP.NET
- DotNetNuke® Community Edition
- Microsoft SQL Server Community & Samples
Most Active Projects
- Rawr
- Farseer Physics Engine
- Windows Presentation Foundation (WPF)
- DotNetZip Library
- patterns & practices SharePoint Guidance
- patterns & practices – Enterprise Library
- Perspective FX : a ShaderEffect generator for WPF and Silverlight
- PHPExcel - OpenXML - Create Excel2007 documents in PHP - Spreadsheet engine
- BlogEngine.NET
- NB_Store - Free DotNetNuke Ecommerce Catalog Module
Loading and drawing a sprite
I've been following the book by Aaron Reed, Learning XNA 3.0.
I've just started reading it, and everything seemed clear up until the second chapter.
I added my sprite to the contents and compiled it.
I then added the line:
| Texture2D texture; |
Between the GraphicsDeviceManager and SpriteBatch lines of code.
I then added:
| Content.Load<Texture2D>(@"Images/logo"); |
In the load content section.
And finally, I added:
| spriteBatch.Begin(); |
| spriteBatch.Draw(texture, Vector2.Zero, Color.White); |
| spriteBatch.End(); |
In the draw section, after the Clear call.
Apparently this should draw the logo on the screen once I hit debug.
However I'm receiving the following error message:
"This method does not accept null for this parameter." "texture"
and it highlights this line:
| spriteBatch.Draw(texture, Vector2.Zero, Color.White); |
Any help would be greatly appreciated. I've understood everything up to this point, but I can't get passed this.
When I created the new file, I selected XNA 3.0 and am using the PC version. I'm also using the Express edition of Microsoft Visual C# 2008.

![17 Again (Blu ray/DVD Combo + Digital Copy) [Blu ray] (Blu ray) newly tagged "blu ray" 17 Again (Blu-ray/DVD Combo + Digital Copy) [Blu-ray]](http://xbox360.wowgoldit.com/wp-content/plugins/wp-o-matic/cache/6a400_51H550K6pGL._SL160_SS160_.jpg)










