Coffee v0.3.0 Release Notes
Release Date: 2019-06-15 // almost 5 years ago-
โ 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 - 0๏ธโฃ 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.- 0๏ธโฃ
Default
implementation forSprite
. #35 - ๐ป
Debug::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. #29- ๐
input::KeyCode
has been moved toinput::keyboard::KeyCode
. #29 - ๐
input::MouseButton
has been moved toinput::mouse::Button
. #29 Batch::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
- ๐ฑ Responsive GUI support! The new