Releases: hecrj/coffee
Releases · hecrj/coffee
0.4.1
0.4.0
Added
Task::succeed
, which replaces the oldTask::new
. #66Default
implementation forui::widget::slider::State
.Default
,Clone
,Copy
,PartialEq
, andEq
implementations forui::widget::button::State
.- Additional color constants:
Color::RED
,Color::GREEN
, andColor::BLUE
. #77 Color::from_rgb_u32
, which allows to constructs aColor
using an hexadecimal literal (0xRRGGBB
). #77From<nalgebra::Matrix3>
andInto<nalgebra::Matrix3>
implementations forTransformation
. #78Game::is_finished
, which allows to gracefully quit the game on demand. #79Canvas::read_pixels
, a method to read the contents of aCanvas
as aDynamicImage
from theimage
crate.ui::Panel
, a dark box that can be used to wrap a widget.ui::ProgressBar
, a progress bar to give visual feedback to your users when performing a slow task.ui::Image
, a simple widget to display agraphics::Image
in your user interface.Mesh::new_with_tolerance
, which allows to control the tolerance of line segment approximations. #100Game::cursor_icon
, which allows customization of the mouse cursor icon.
Changed
Mesh::stroke
now takes anf32
asline_width
instead of au16
.Task::new
now supports a lazy operation that can fail. #66- Face culling has been disabled for Vulkan, Metal, D3D11, and D3D12 backends. In OpenGL, face culling was already disabled.
Transformation::nonuniform_scale
now takes aVector
. #78- The logic of
KeyboardAndMouse
has been split into the newKeyboard
andMouse
input trackers. The newmouse
andkeyboard
methods can be used to obtain them, respectively. #69 - The
Mouse
type can now track additional input: - The
mesh
example now has a slider to control the tolerance. #100
Fixed
- Hang when
Game::TICKS_PER_SECOND
is set as0
. #99
0.3.2
Fixed
- Incorrect buffer sizes in the
Mesh
pipeline. This caused vertices to entirely disappear when rendering big meshes, leading to a potential crash. 79651405673ecd16da21b887a622f6650b29f38f - Validation error when rendering meshes using Vulkan, Metal, D3D11, or D3D12. #81
0.3.1
0.3.0
Added
- Responsive GUI support! The new
ui
module can be used to extend aGame
and build a user interface. #35- GUI runtime based on Elm and The Elm Architecture.
- Layouting based on Flexbox and powered by
stretch
. - Built-in GUI widgets. Specifically: buttons, sliders, checkboxes, radio buttons, rows, and columns.
- Built-in GUI renderer. It is capable of rendering all the built-in GUI widgets.
- Customization. The
ui::core
module can be used to implement custom widgets and renderers.
- Gamepad support. The
input::Event
enum now has aGamepad
variant. #29 - Mesh support. The types
Shape
andMesh
have been introduced. Rectangles, circles, ellipses, and polylines can now be drawn with ease using fill or stroke modes. #50 - The
Game::LoadingScreen
associated type. Given that all theGame
associated types implement a trait with aload
method, wiring a loading screen now is as simple as writing its name. Because of this, theGame::new
method is no longer necessary and it is dropped. #35 Input
trait. It allows to implement reusable input handlers. #35KeyboardAndMouse
input handler. Useful to quickstart development and have easy access to the keyboard and the mouse from the get-go. #35CursorTaken
andCursorReturned
mouse input events. They are fired when the cursor is used/freed by the user interface. #35- Off-screen text rendering support.
Font::draw
now supports anyTarget
instead of a windowFrame
. #25 Game::debug
performance tracking. Time spent on this method is now shown in the built-in debug view. #26- Implementation of
Default
trait forText
. #25 Transformation::rotate
. Creates a transformation representing a rotation. #28Batch::clear
. Clears the batch contents, useful to reuse batches in different frames.- Implementation of
Extend
forBatch
. #37 - Implementation of
ParallelExtend
forBatch
. ABatch
can now be populated using multiple threads, useful to improve performance when dealing with many thousands of quads. #37 Text
alignment. It can be defined using the newHorizontalAlignment
andVerticalAlignment
types in thegraphics
module. #35Font::measure
. It allows to measure the dimensions of anyText
. #35Rectangle::contains
. It returns whether or not aRectangle
contains a givenPoint
. #35Sprite::scale
. It can be used to change theSprite
size when drawed.Default
implementation forSprite
. #35Debug::ui_duration
. It returns the average time spent running the UI runtime.- A counter example as an introduction to the new UI architecture. #35
- A user interface example that introduces the different built-in widgets. #35
- A gamepad example that displays the last gamepad event. #29
- A mesh example that showcases the different ways to use the new
Mesh
andShape
types. #50 - Multiple gravity centers based on mouse clicks in the particles example. #30
Changed
- The
Game::Input
associated type now has to implement the newInput
trait. This splits code quite nicely, as theon_input
method moves away fromGame
. It also makesInput
implementors reusable. For instance, aKeyboardAndMouse
type has been implemented that can be used out of the box! #35 Game::draw
now takes aFrame
directly instead of aWindow
. #35LoadingScreen::on_progress
has been renamed toLoadingScreen::draw
and it now receives aFrame
instead of aWindow
. #35input::Event
is now split into four different variants representing input sources:Keyboard
,Mouse
,Gamepad
, andWindow
. Each one of these sources has its own module insideinput
with anEvent
type where the old variants can be found. #29input::KeyCode
has been moved toinput::keyboard::KeyCode
. #29input::MouseButton
has been moved toinput::mouse::Button
. #29Batch::draw
andtexture_array::Batch::draw
do not take aposition
argument anymore. UsingTarget::transform
before drawing is preferred. #53Font::load
has been renamed toFont::load_from_bytes
for consistency. #55- The performance of the particles example has been improved considerably on all platforms. #37
- The
input
example uses the newui
module now.
Removed
- The
Game::View
associated type. Implementors of theGame
trait are also meant to hold the game assets now. This simplifies the API considerably, and it helps model your game state-view relationship with precision, avoiding inconsistencies. #35 Game::new
.Game::load
should be used instead. #35Game::on_input
. Input handlers now must be implemented using the newInput
trait. #35
0.2.0
Added
Game::on_close_request
to control whether the game should be closed when the window receives a close request by the OS. #14input::Event::TextInput
event, which triggers on text entry. Contains the character typed as achar
. #15input::Event::CursorEntered
andinput::Event::CursorLeft
events, which trigger when the mouse cursor enters or leaves the game window, respectively. #15input::Event::MouseWheel
, which triggers when the mouse wheel is scrolled. Contains the number of horizontal and vertical lines scrolled asf32
. #15input::Event::WindowFocused
andinput::Event::WindowUnfocused
, which trigger when the game window gains or loses focus, respectively. #15input::Event::WindowMoved
, which triggers when the game window is moved. Contains the new X and Y coordinates of the window asf32
. #15- Text rendering for the
wgpu
graphics backend. Vulkan, Metal, D3D11 and D3D12 now support text rendering. OpenGL already supported text rendering. #18 - A changelog. #20
- Example to showcase input handling. #15
- Example to showcase proper colors and gamma correction. #19
Changed
- The debug view is now shown by default when the
debug
feature is enabled.