Cardoso.SceneDisplayer 0.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cardoso.SceneDisplayer --version 0.0.9                
NuGet\Install-Package Cardoso.SceneDisplayer -Version 0.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cardoso.SceneDisplayer" Version="0.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cardoso.SceneDisplayer --version 0.0.9                
#r "nuget: Cardoso.SceneDisplayer, 0.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Cardoso.SceneDisplayer as a Cake Addin
#addin nuget:?package=Cardoso.SceneDisplayer&version=0.0.9

// Install Cardoso.SceneDisplayer as a Cake Tool
#tool nuget:?package=Cardoso.SceneDisplayer&version=0.0.9                

SceneDisplayer

The Scene Displayer Library is built on top of SDL. It allows to easily render scenes that contain 2D objects in C# .Net. Since it is built on top of SDL, the library intends to be able to target Windows, MacOS and Linux.

The main purpose of this project is to make it simple to render multiple scenes, by abstracting some of the SDL rendering logic.

Anything that renders something on a scene is called an Entity. There are multiple Entities already defined on this library, like basic shapes (rectangles, lines, circles), text or images.

The library allows to mix the already defined Entities, to form new Entities, which makes it simple to define different kinds of UI objects.

The library is intended to be used for:

  • 2D Graphical applications developed relatively quickly and easily.
  • 2D Graphical applications that use mostly the Entities defined by the library, or a mix of them.
  • 2D Games.
  • Simple slideshows.
  • Applications developed in C#, for Desktop.

The library is not intended to be used for:

  • Complex graphical applications, with different kinds of UI elements. Although it is possible to do more complex applications with this library, you most likely would have to define multiple Entities before-hand.
  • Classic desktop applications, that use mostly IO elements (e.g. TextBoxes, ComboBoxes, etc.).
  • 3D Graphical applications

Dependencies

.Net 5.0 SDK

SDL2 Runtime Binaries

Getting started

  • Create a new console application: -With Visual Studio

    Create a new Project → Console App

    -With CLI

    dotnet new console
    
  • Install the Nuget package

  • Add the SDL2 binaries to the build:

    • Create a folder on the project folder that was created. In this example we will call the folder "lib". If you choose a different name, you must replace "lib" with the name you chose, on the following steps.

    • Copy all the SDL2 Runtime Binaries to this folder.

    • Automatically copy those binaries to the output folder, after build time: -With Visual Studio

      Go to Project Properties → Build Events

      On "Post-build event command line" add the following line:

      copy "$(SolutionDir)\lib\*" "$(TargetDir)"
      

      -With CLI

      Edit the <Project-name>.csproj file.

      Inside the Project tag, add the following:

      <Target Name="PostBuild" AfterTargets="PostBuildEvent">
        <Exec Command="copy &quot;$(SolutionDir)\lib\*&quot; &quot;$(TargetDir)&quot;" />
      </Target>
      
Hello World
  • In order to display something on the screen, we must define a Scene and initialize it with the SceneManager.

  • The following code should display an empty blue window:

using SceneDisplayer;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            SceneManager.Init(new TestScene(), "Hello World");
            SceneManager.Render();
            SceneManager.Dispose();
        }
    }

    public class TestScene : Scene
    {
    }
}
  • We defined a Scene, called TestScene, and created an instance of it to be passed on the SceneManager.Init method, alongside with the window title "Hello World".

  • SceneManager.Render is a blocking method, that does all the rendering logic, and listens to events.

  • Finally, SceneManager.Dispose is called when the application is closed, in order to release the used resources.

  • For additional information on how to add Entities and how to interact between them and the Scenes, read the documentation.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.6 381 3/28/2021
0.1.5 337 3/28/2021
0.1.4 335 3/27/2021
0.1.3 361 3/21/2021
0.1.2 350 3/14/2021
0.1.1 301 3/14/2021
0.1.0 300 3/13/2021
0.0.13 328 3/13/2021
0.0.12 372 3/11/2021
0.0.11 349 2/12/2021
0.0.10 379 2/12/2021
0.0.9 390 2/12/2021
0.0.8 353 2/11/2021
0.0.7 380 2/11/2021
0.0.6.2 394 2/11/2021
0.0.5 380 2/11/2021
0.0.4 378 2/9/2021
0.0.3 363 2/9/2021
0.0.2 379 2/9/2021
0.0.1 386 2/8/2021