SadConsole is a generic library that emulates old-school console game systems. It provides command prompt-style graphics where one or more tile textures are used to represent an ASCII character set. Console's are made up of a grid of cells, each of which can have its own foreground, background, glyph, and special effect applied to it.
While SadConsole is a generic library that doesn't provide any rendering capabilities, "host" libraries are provided that add renderers to SadConsole. The two hosts provided by this library are for MonoGame and SFML.
SadConsole currently targets .NET 6, .NET 5, .NET Core 3.1, and .NET Standard 2.1.
For the latest changes in this release, see the notes below
Here are some of the features SadConsole supports:
- Show any number of consoles.
- Uses graphical tile-based images to build out an ASCII-character font with support for more than 256 characters.
- Use more than one font file. However, each console is restricted to a single font.
- Independently controlled entities for game objects.
- Keyboard and Mouse support.
- Text UI control framework.
- Windowing capabilities.
- Importers for DOS ANSI files, TheDraw text fonts, RexPaint, and Playscii.
- Animation support.
- Translating images to text-blocks.
- Highly customizable system.
String display and parsing
SadConsole uses NuGet for its .NET dependencies:
- Newtonsoft.Json (>= 13.0.1)
- TheSadRogue.Primitives (>= 1.0.0)
(v9.2.2 Fix conversion of Mirror to SpriteEffects)
(v9.2.1 Fix API documentation generation)
Print(int x, int y, ColoredGlyph glyph)renamed to
- [Breaking] Surface
SetEffectmethod signatures have changed.
- [Breaking] Renamed
- [Breaking] Removed
ColorGradientas this type is implemented in the SadRogue.Primitives library as
ColoredString.String.Setforced the string through the parser. This has now changed to use the characters directly.
- [Behavior] All
ColoredStringcontructors that used the
(string)overload used the string parser. This is no longer the case.
ColoredString.IgnoreEffectno longer defaults to
- [Behavior] Using
Surface.Printmethods that used the string parser for fore/back/mirror will force those settings after the string was parsed and not before.
- [Behavior] Surface
Fillmethods now clear the effect.
- New overload added that accepts decorators.
- Print clears the effect over the glyphs printed.
- Print that uses the string processor now processes the string and then sets the appropriate overloaded settings. For example, the overload that sets the foreground and background colors will process the string and then set the foreground and background of the entire string. This is a change from previous behavior which set the colors at the start of the string processor and allowed the processor to override the overload.
- [MonoGame] Added DrawCallManager to allow injecting custom sprite batch rendering during final scene composition.
- [MonoGame/SFML] Fixed a bug that caused all surfaces to redraw all cells 100% of the time even if nothing changed. Should bring 300%-400% fps increase in surfaces that aren't changing content.
- [MonoGame/SFML] ITexture improvements for GetPixel/SetPixel; Demos on editing textures. (RychuP)
- [MonoGame/SFML] The game host now has a
FrameNumberproperty that increments each frame cycle.
- [SFML] Fixed
Settings.UnlimitedFPS. This now works.
- [Core] Fixed bug that caused redraws every frame even if nothing had changed.
- [Core] Cursor didn't respect
Cursor.UseStringParserbecause of how
ColoredStringwas always using the string parser. This is fixed now.
- [Core] Cursor has a
Cursor.MouseClickRepositionHandlesMouseproperty which sets the handled flag on mouse left-click for the cursor reposition.
- [Core] Cursor updates the space character appearance while printing. Previously only the first character was used to determine the space's appearance.
DrawStringinstruction overrides reset now, fixing a bug with having the instruction run more than once.
Surface.ShiftLeft|Right|Up\Downmethods now move decorators.
- [Core] New
Surface.ShiftColumnmethods added. (Chris3606)
ColoredString.SetDecoratorsadded, to fit in with
- [Core] Renamed
EffectSetand added new
- [Core] Effects use
TimeSpaninstead of double.
- [Core] The
EffectsManagerused by a surface now works on cell instances, not cell indices.
- [Core] Resizing a surface without the
clearparameter keeps existing effects instead of dropping them.
AnimatedSurface.FromImagehelper added which converts image-based animations to an animated surface. (RychuP)
- [Core] Added TheDraw font reader:
SadConsole.Readers.TheDrawFont. Not a SadConsole Font.
- [Core] Playscii support added in the
- [Core] Entity renderer has a
RemoveAllmethod to clear out all the entities.
- [Core] Entity renderer now has a
SkipExistsChecksproperty which can greatly improve performance when adding/removing entities (when you already have a lot of entities).
- [Core] For entities, added
AnimatedAppearanceComponentwhich can be added to an entity to animate the glyph like the
AnimatedSurfacedid for the old entity type.
- [UI] Fix various minor bugs with controls.
Textboxhas more events related to text changing.
Textboxbehaviors have changed slightly. For example,
EditingTextevent doesn't fire when the text ends up being the same before editing.
ListBoxitems can be inserted as a
ValueTuple<string, object>which will use the string (can be a
ColoredString) as the display text of the item.
- [StringParser] Introduced new interface for string parsing:
- [StringParser] Moved current parse code to
ColoredString.Parseis obsolete and forwards to
- [StringParser] String processor now has a decorators command:
- [StringParser] String processor no longer hides effects until they're used. All processed strings will set a null effect that will be set on the cells that are printed.
- [ExtendedLib] Added ClassicConsoleKeyboardHandler and C64KeyboardHandler for cursor handlers.
- [ExtendedLib] Added MoveViewPortKeyboardHandler component.
- [ExtendedLib] Added
surface.PrintFadingTextextension method that prints text using the
DrawStringinstruction with an effect.