Releases: VincentFoulon80/console_engine
1.0.0
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
andengine.get_mouse_released
now require that you provide a MouseButton as first parameterscreen.to_string()
as well aspixel.to_string()
no longer exists. If you want to print a screen you'll now usescreen.draw()
instead.pixel.colors
has been replaced bypixel.fg
andpixel.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
byCrossterm
0.7.0
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
andprint_fbg
now uses &str instead of StringPubScreen
no longer exists
Additions
- Added more functions to create Screens :
new_empty
,new_fill
- Added two new drawing functions :
h_line
andv_line
These are optimized algorithms to render horizontal and vertical lines
Don't worry about using them, theline
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
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
Add screen-swap example + rustdoc example links
0.6.0
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 viaset_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 ConsoleEnginescreen-embed
: Example usage of Screen'sprint_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()
andget_height()
functions.
Deprecations
scr_w()
,scr_h()
: Replaced byget_width()
andget_height()
.
These functions will trigger a deprecation warning and will be deleted in version 1.0
0.5.0
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
Optimized rendering for Windows terminals
0.4.0
Features / Change
- Add mouse support to console_engine :
get_mouse_press
to get coordinates of the mouse position if the provided button is pressedget_mouse_held
to get coordinates of the mouse position if a button is currently heldget_mouse_released
to get coordinates of the mouse position if a button has been released
- Add examples :
⚠️ behavior changed : Nowprint
andprint_fbg
doesn't wrap around the screen anymore. Characters out of bounds will be ignored.
0.3.0
Features / Changes
- Add
triangle
andfill_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 linefill_rect
with reverse coordinates did not draw anything
0.2.1
- Optimize draw() : only write changes to the screen
- Add 'lines-fps' example