More
See all Show me
Starting an engine project; implementing the VBContentManager class
Credits
Tags
  • wayne walker 8 months ago
    Where is the
    -VBContentManager
    -Hashtable
    that i use?
    I cant go on without them!
  •  
  • the xna machine 8 months ago
    Check out the blog at xnamachine.blogspot.com

    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).
  •  
  • Sumnewdude 2 months ago
    Hello I don't know if you check this that often but Im getting this error.
    "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 xna machine 2 months ago
    That error indicates that a texture called "kermit" hasn't been loaded into objCM.Textures - but it's hard to say why without seeing your project or code.

    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?
  •  
  • Sumnewdude 2 months ago
    Yes kermit.png is in my Textures folder. . . here is my code.
    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
  •  
  • the xna machine 2 months ago
    XNA's Content Pipeline removes the file extensions from resources when it brings them in, so when accessing content from in the game, you'll want to drop the extension from the name; try getting "kermit" from your textures collection instead of "kermit.png".
  •  
  • Sumnewdude 2 months ago
    That dosn't work either. . . I must have missed somthing else in this video.
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.