fsharp-gamecore 0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package fsharp-gamecore --version 0.0.5                
NuGet\Install-Package fsharp-gamecore -Version 0.0.5                
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="fsharp-gamecore" Version="0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add fsharp-gamecore --version 0.0.5                
#r "nuget: fsharp-gamecore, 0.0.5"                
#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 fsharp-gamecore as a Cake Addin
#addin nuget:?package=fsharp-gamecore&version=0.0.5

// Install fsharp-gamecore as a Cake Tool
#tool nuget:?package=fsharp-gamecore&version=0.0.5                

fsharp-gamecore

A fleshed-out game loop from MonoGame with supporting classes, intended to be used as the core loop of larger games.

This is for 2D games only, i.e. those that use 2d textures like sprites and raw colours. It also supports sounds, music and fonts.

Designed so that all XNA bits and necessary mutable fields are wrapped inside the internal GameLoop class, allowing a parent application to remain purely functional and almost platform agnostic. Entry point is the runGame method from the GameRunner module.

Available on Nuget at: https://www.nuget.org/packages/fsharp-gamecore/0.0.5

Updates for 0.0.4 vs 0.0.3

I've reworked so the meta config of the game is buried in a record type, and so the entry to the game is via a functional method (no more use of the ugly class).

Updates for 0.0.5

The way text is drawn has changed in a breaking way, but for the better: instead of specifying position, origin and scale, with the last being basically trial and error based on how the font was specified, you instead specify a destination rect and a alignment within that rect. The scale is dynamically calculated to ensure the text can fit inside that rect, and then adjustments are made based on alignment.

This makes text drawing more accurate and easy, while also aligning the specification of text view artifacts with the way images and colours are specified (which also just take rects). This also fixes a bug where drawing centre-aligned text at lower scales would not be centred properly, and it now trims off extra line spacing gaps at the bottom of text.

0.0.5 also includes:

  • the ability to draw multiline text via Paragraph (as compared to text, and which takes a string list of lines)
  • a simplified game runner 'runWindowedGame' that takes a window size and asset list instead of a config object, and defaults to aliceBlue for clear colour and no fpsCounter

Samples

In this repository (or if you follow the repo url, if using Nuget), there is a samples folder containing a simple game demonstrating the use of the various hooks. For more advanced usage, check other projects on my Github. DungeonRaider (https://github.com/ChrisPritchard/DungeonRaider) uses this repo, for example.

License

Provided under Unilicense (except for the font, see below), so go nuts.

Font and its License

The sample project includes a font that is compiled by the monogame pipeline. The font used is 'Connection', from here: https://fontlibrary.org/en/font/connection

This font is provided under the SIL Open Font License, a copy of which lies in the root of this repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on fsharp-gamecore:

Package Downloads
fsharp-gamecore-imgui

Wrappers and helpers for ImGui.NET integration with FSharp-GameCore

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.8 1,140 1/29/2019
0.0.7 840 1/24/2019
0.0.6 686 1/11/2019
0.0.5 633 1/9/2019
0.0.4 782 10/13/2018
0.0.3 746 10/8/2018