Skip to content

Releases: VincentFoulon80/console_engine

1.0.0

23 May 11:17
Compare
Choose a tag to compare

First "Stable" Release of console_engine !

It's after some hours of migrating code and fixing bugs that I'm now releasing the version 1.0.0 of console_engine ! I actually expected a more difficult challenge to migrate from one lib to another, but finally everything is still in place, and working better than ever !

I noticed that mouse input was buggy when using termion, there was many times where it panicked without us having any control of that. Also, Windows support was limited because still in development.

This 1.0 release is now using crossterm instead of termion, so you'll have to change some things to port your code to this version. Fortunately, there's an upgrade guide available !

💥 Breakings

  • every use console_engine::termion::* has been replaced by new enums and structs
  • engine.get_mouse_held and engine.get_mouse_released now require that you provide a MouseButton as first parameter
  • screen.to_string() as well as pixel.to_string() no longer exists. If you want to print a screen you'll now use screen.draw() instead.
  • pixel.colors has been replaced by pixel.fg and pixel.bg

see the Upgrade Guide for more in-depth information about how to migrate your code

Additions

  • 🎉 Windows is now fully supported !
  • Added engine.is_key_pressed_with_modifier(), engine.is_key_held_with_modifier(), engine.is_key_released_with_modifier()
    These functions allows you to check if a key is pressed with a specific modifier (ctrl, shift, ...)
  • Added engine.get_mouse_press_with_modifier, engine.get_mouse_held_with_modifier, engine.get_mouse_released_with_modifier
    Same feature as above, but with the mouse
  • Added engine.is_mouse_scrolled_down, engine.is_mouse_scrolled_up and _with_modifier variants.
    These functions returns true if the user has scrolled up or down, with or without a specific modifier (ctrl, shift, ...)
  • Added pixel.get_colors() that returns a tuple containing respectively the foreground then the background color

Changes

  • Replaced the lib Termion by Crossterm

0.7.0

22 May 22:08
Compare
Choose a tag to compare

Coming Soon : Crossterm instead of Termion

I'm currently working to replace termion by crossterm internally. This won't change much on your side except the use console_engine::termion::*. Just be aware that this version 0.7.0 is the last version to still use termion. You can already start to fix the following breakings but keep in mind that the next version will have some small breakings too. I'll give some migration instructions on the next release note !

💥 Breakings

  • print and print_fbg now uses &str instead of String
  • PubScreen no longer exists

Additions

  • Added more functions to create Screens : new_empty, new_fill
  • Added two new drawing functions : h_line and v_line
    These are optimized algorithms to render horizontal and vertical lines
    Don't worry about using them, the line function automatically calls them when needed

Changes

  • [internal] time_limit is now a Duration instead of a u128
  • [internal] input capture now uses collection functions
  • [internal] refactored mouse events
  • [internal] improved Screen's empty state
  • [internal] Pixel now derive Eq and PartialEq
  • [internal] Follow Clippy's recommandations + cargo fmt

0.6.2

21 May 13:37
Compare
Choose a tag to compare

Additions

  • Added a new function for Screen and ConsoleEngine : print_screen_alpha.
    This function performs a print_screen but will ignore a specific character (provided as the last parameter), giving a transparency behavior
  • Added a new example using this function : tetris

0.6.1

19 May 18:01
Compare
Choose a tag to compare
Add screen-swap example + rustdoc example links

0.6.0

18 May 18:09
Compare
Choose a tag to compare

Additions

  • Added a Screen struct that is used the same way as ConsoleEngine's drawing functions
    These screens can be used as standalone tools to print on your own console application. Useful when you don't want the keyboard / mouse support or terminal management provided by ConsoleEngine.
  • Added the ability to print a subscreen into another Screen. See example screen-embed (also works with ConsoleEngine struct)
  • Added the ability to extract the Screen of a ConsoleEngine application, via get_screen(). The other way also works via set_screen().
    This feature is useful if you want to manage several screens without redrawing them everytime. You just need to store the current screen into a variable and then import the screen you want to display instead.
  • Added two new examples for Screen structure :
    • screen-simple : Example usage of Screen struct instead of ConsoleEngine
    • screen-embed : Example usage of Screen's print_screen() function to embed one screen into another

Changes

  • Refactored the ConsoleEngine struct to use Screen objects instead of its own logic.
    You don't need to worry about this change, because now ConsoleEngine is acting as a wrapper for a Screen. Everything is still in place and nothing should be broken.
  • Changed some examples to use the new get_width() and get_height() functions.

Deprecations

  • scr_w(), scr_h() : Replaced by get_width() and get_height().
    These functions will trigger a deprecation warning and will be deleted in version 1.0

0.5.0

06 May 21:22
Compare
Choose a tag to compare

Features / Changes

  • Add a function to handle terminal resizing, check_resize
    This function does not handle resizing below the minimal required screen for now.

0.4.1

06 May 09:43
Compare
Choose a tag to compare
Optimized rendering for Windows terminals

0.4.0

22 Apr 11:50
Compare
Choose a tag to compare

Features / Change

  • Add mouse support to console_engine :
    • get_mouse_press to get coordinates of the mouse position if the provided button is pressed
    • get_mouse_held to get coordinates of the mouse position if a button is currently held
    • get_mouse_released to get coordinates of the mouse position if a button has been released
  • Add examples :
  • ⚠️ behavior changed : Now print and print_fbg doesn't wrap around the screen anymore. Characters out of bounds will be ignored.

0.3.0

19 Apr 12:42
Compare
Choose a tag to compare

Features / Changes

  • Add triangle and fill_triangle functions (with rustyPixelGameEngine's fill_triangle implementation)
  • Redesigned line function (using Bresenham's line algorithm)
  • Reworked shapes example : it became a shape testing tool
  • 💥 breaking : drawing functions (set_pxl, line, circle, etc...) now uses i32 instead of u32 for coordinates
  • 💥 breaking : get_pxl now returns Result<Pixel, String> instead of panicking
  • set_pxl now won't trigger a panic when trying to write out of bounds. It'll just ignore the call.

Bugfixes

  • fill_rect did not draw the last line
  • fill_rect with reverse coordinates did not draw anything

0.2.1

18 Apr 14:13
Compare
Choose a tag to compare
  • Optimize draw() : only write changes to the screen
  • Add 'lines-fps' example