MonoGame Tiled – Extract Texture2D

NEZ, an open source MonoGame framework extension, provides the functionality to import and render a tiled map. (.tmx) If MonoGame and NEZ isn’t a term for you, consider reading an introduction article first. Recap: Following code does allow us to render a tiledmap with the NEZ’s ECS system var tmx = Core.Content.Load<TiledMap>(“Map”); Entity mapEntity = …

Outline Shader

Actually I think the outline shader for a 2D game is kinda unnecessary. The loaded sprite can already be shipped with an outline. (Or, one sprite with and one sprite without an outline; if both are required) However, I kinda find it neat to dynamically apply an outline to whatever object I want to. Fundamental …

Empty Vertex + Pixel Shader

Structure The code starts with #defines we already know from C or C++. We basically map HLSL and GLSL constants (shader and vertex models, etc.) into a variable; beeing chosed during the compile time, in order to support HLSL and GLSL in one single .fx file. #if OPENGL #define SV_POSITION POSITION #define VS_SHADERMODEL vs_3_0 #define …

.NET Core on Linux (Ubuntu 18.10) ‘NuGetFallbackFolder’ Error

Permission denied to modify the ‘/usr/share/dotnet/sdk/NuGetFallbackFolder’ folder. Here are some options to fix this error: —————————————- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. How to fix this issue sudo su apt-get remove dotnet-sdk-CURRENT_VERSION rm /usr/share/dotnet/dotnet -r rm /usr/bin/dotnet -r mkdir -p …

C# 8.0 Features

This article covers the new C# 8.0 language feature-set and their C# 7.0 implementation equivalent. Some of the features (links in the article) can be tested already with the Visual Studio 2019 preview. Interface Default Implementation Finally! I think there is no explanation required for this feature. Output Hello from the DiagnosticLogger implementation Hello from the …