{"id":21105296,"url":"https://github.com/aristurtledev/monogame-visual-basic-example","last_synced_at":"2026-03-19T18:54:17.908Z","repository":{"id":185423131,"uuid":"673520227","full_name":"AristurtleDev/monogame-visual-basic-example","owner":"AristurtleDev","description":"An example of MonoGame DesktopGL project using Visual Basic","archived":false,"fork":false,"pushed_at":"2023-08-01T20:48:50.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-09T09:51:10.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Visual Basic .NET","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AristurtleDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-01T20:19:58.000Z","updated_at":"2024-12-22T22:15:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc35003f-1cda-48c0-b29e-e9da6994e3fa","html_url":"https://github.com/AristurtleDev/monogame-visual-basic-example","commit_stats":null,"previous_names":["aristurtledev/monogame-visual-basic-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AristurtleDev/monogame-visual-basic-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AristurtleDev%2Fmonogame-visual-basic-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AristurtleDev%2Fmonogame-visual-basic-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AristurtleDev%2Fmonogame-visual-basic-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AristurtleDev%2Fmonogame-visual-basic-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AristurtleDev","download_url":"https://codeload.github.com/AristurtleDev/monogame-visual-basic-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AristurtleDev%2Fmonogame-visual-basic-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29060578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T22:28:58.191Z","status":"ssl_error","status_checked_at":"2026-02-03T22:28:56.515Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T00:05:04.620Z","updated_at":"2026-02-03T22:32:15.743Z","avatar_url":"https://github.com/AristurtleDev.png","language":"Visual Basic .NET","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonoGame Visual Basic Example\nThis is an example of using MonoGame with VB.NET instead of c#.  This example uses the MonoGame Desktop GL Template.\n\nBelow you can find the step-by-step instructions on doing this manually if you would prefer instead of using this template.\n\n## Step 1: Creating The Project\nFirst create a new **Visual Basic Console Application** project.  Once the project has been created, edit the `.vbproj` file and change the `\u003cOutputType\u003eExe\u003c/OutputType\u003e` to `\u003cOutputType\u003eWinExe\u003c/OutputType\u003e`\n\n## Step 2: Creating Content Directory\nNext, create a new directory in the project directory called `Content`.  Inside this directory create a new file called `Content.mgcb` and add the following boilerplate to the `Content.mgcb` file you just created\n\n```\n#----------------------------- Global Properties ----------------------------#\n\n/outputDir:bin/$(Platform)\n/intermediateDir:obj/$(Platform)\n/platform:DesktopGL\n/config:\n/profile:Reach\n/compress:False\n\n#-------------------------------- References --------------------------------#\n\n\n#---------------------------------- Content ---------------------------------#\n```\n\n## Step 3: Add Nuget References\nNext, you will need to add the NuGet References.  The first is the `MonoGame.Content.Builder.Task` NuGet.  This is absolutely required in order for asset build + copy to output automatically when you build your project.\n\nNext, you will need to add the correct project type depending on what you are targeting. For instance, the MonoGame DesktopGL Nuget is `MonoGame.Framework.DesktopGL`.  The DirectX version is `MonoGame.Framework.WindowDX`.  Choose the one that is appropriate for your project type\n\n## Step 4: Setup the `dotnet tool`s\nNext you will need to setup the **dotnet tool**s used by MonoGame for content/asset building.  Open a new terminal in the project directory and enter the following commands one after the other\n\n```sh\ndotnet new tool-manifest\ndotnet tool install dotnet-mgcb\ndotnet tool install dotnet-mgcb-editor\ndotnet tool install dotnet-mgcb-editor-linux\ndotnet tool install dotnet-mgcb-editor-windows\ndotnet tool install dotnet-mgcb-editor-mac\n```\n\n## Step 5: Create Game1.vb Class\nNext, create a new class file called `Game1.vb`. Replace all code inside that file with the following. The following is just the default MonoGame template boilerplate converted to VB from C#\n\n```vb\nImports System.Runtime.CompilerServices\nImports Microsoft.Xna.Framework\nImports Microsoft.Xna.Framework.Graphics\nImports Microsoft.Xna.Framework.Input\n\nPublic Class Game1\n    Inherits Game\n\n    Dim _graphics As GraphicsDeviceManager\n    Dim _spriteBatch As SpriteBatch\n\n    Sub New()\n        _graphics = New GraphicsDeviceManager(Me)\n        Content.RootDirectory = \"Content\"\n        IsMouseVisible = True\n    End Sub\n\n    Protected Overrides Sub Initialize()\n        'TODO: Add your initialization logic here\n        MyBase.Initialize()\n    End Sub\n\n    Protected Overrides Sub LoadContent()\n        _spriteBatch = New SpriteBatch(GraphicsDevice)\n        'TODO use Me.Content to load your game content here\n        MyBase.LoadContent()\n    End Sub\n\n    Protected Overrides Sub Update(gameTime As GameTime)\n        If GamePad.GetState(PlayerIndex.One).Buttons.Back = ButtonState.Pressed Or Keyboard.GetState().IsKeyDown(Keys.Escape) Then\n            Me.Exit()\n        End If\n\n        'TODO Add your update logic here\n\n        MyBase.Update(gameTime)\n    End Sub\n\n    Protected Overrides Sub Draw(gameTime As GameTime)\n        GraphicsDevice.Clear(Color.CornflowerBlue)\n\n        'TODO: Add your drawing code here\n        MyBase.Draw(gameTime)\n    End Sub\n\nEnd Class\n```\n\n## Step 6: Edit `Program.vb`\nThe final step is to edit `Program.vb` so that it creates a new instance of the `Game1` class and runs it.  Replace all code inside `Program.vb` with the following\n\n```vb\nImports System\n\nModule Program\n    Sub Main(args As String())\n        Using game As New Game1\n            game.Run()\n        End Using\n    End Sub\nEnd Module\n```\n\nAt this point, you should be able to run the project and get the default CornflowerBlue window as expected.  Happy coding!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faristurtledev%2Fmonogame-visual-basic-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faristurtledev%2Fmonogame-visual-basic-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faristurtledev%2Fmonogame-visual-basic-example/lists"}