
VB.NET XNA Tutorial 4: Starting an engine
9 months ago
Starting an engine project; implementing the VBContentManager class
This conversation is missing your voice. Take five seconds to join Vimeo or log in.
- Vimeo: About / Blog / Roadmap / Developers / Forums / Help! / Site Map
- Legal: © 2008 Connected Ventures, LLC. All rights reserved. / Terms & Conditions / Privacy Statement



.
226
0
7
0
0
Previous Week
-VBContentManager
-Hashtable
that i use?
I cant go on without them!
The source for both VBContentManager and Hashtable(Of Type) are posted in the article for Tutorial 4. I recently posted an updated version of the VBContentManager for use with XNA (Game Studio) 2.0 (beta).
"This method does not accept null for this parameter. Parameter name: texture" at line "Me.objSB.Draw(Me.objCM.Textures("kermit"), Vector2.Zero, Color.White)" Thanks for your help!
The error is coming from SpriteBatch, it's yelling at you for trying to draw a sprite but without a texture. If "kermit" does not really exist in objCM.Textures, Nothing will be the result of trying to get "kermit" out of the Textures collection. Do you have a graphics file called kermit in your Content\Textures folder?
Public Class XNAGame
Inherits Mybasegame
Public Sub New()
MyBase.new("XNA Game", True, "C:\Users\WeldFire\Documents\Visual Studio 2008\Projects\XNA Game\XNA Game\Content")
End Sub
Protected Overrides Sub draw(ByVal gametime As Microsoft.Xna.Framework.GameTime)
MyBase.Draw(gametime)
Me.objGDM.GraphicsDevice.Clear(Color.Black)
Me.objSB.Begin(SpriteBlendMode.AlphaBlend)
Me.objSB.Draw(Me.objCM.Textures("kermit.png"), New Vector2(100, 100), Color.White)
Me.objSB.End()
End Sub
End Class