Rubato

Latest version: v1.0.0

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

1.0.0

Breaking Changes

- `Text` no longer can affect `Font`s directly.
- Entirely removed the `Group` class. This means code utilizing groups will need to be significantly refactored.
- Refactored `Scene`s as a consequence of the removal of groups. See documentation for more information.
- Added `ignore_cam` option to `GameObject`s. This decides whether the gameobject respects the scene's camera when it
draws. Replaces the previous UI group behavior.
- Reordered some function arguments for many functions and constructors to prioritize more used arguments.

Added

- `Tilemap` and `SimpleTilemap` components
- `GameObject` now have children whose positions, rotations and z_index are relative to their parents. Use
`gameobject.set_parent()` to set a parent.
- `hitbox.should_collide()` which can be overriden to determine whether a hitbox should collide with another.

Changed

- The default window size now matches the resolution instead of being half it to be more intuitive.
- Changed default resolution to (500, 500).
- `font.add_style` and `font.remove_style` no longer look if the thing you are removing or adding exists.
- `Font` styles are integers you | together.
- Exe files will not crash on closing in Windows.
- `GameObject`s no longer have a default name. Instead it is now "".

Removed

- `Time.milli_to_sec()` and `Time.sec_to_milli()` because they were unused.

Fixed

- `surface.blit()` now uses cartesian coordinates like the rest of rubato.
- `Time.target_fps` now caps the fps as the correct value.

0.4.0

Breaking Changes

- Hidden a LOT of methods that weren't meant to be touched by users.
- Renamed `surface.get_size()` to `surface.size_scaled()` and `surface.get_size_raw()` to `surface.size()`.
- Removed `Game.camera`. Good code should use the scene's camera directly or `Game.current().camera`.
- Made `Game.current()` a classmethod instead of a property. This is to make it more obvious that it is read-only.
- Restructured the Joystick input system to make it easier to work with in more complex settings.
- Changed external `Time` methods and attributes to use seconds instead of milliseconds where applicable.
- Fullscreen option in `init()` is now a boolean.
- Added maximize option to `init()`.
- Renamed `Surface` and `Raster` `draw_point()` functions to `set_pixel()`.
- Removed `get_pixel_tuple()` because you can just do `get_pixel().to_tuple()`.
- Renamed `Draw.point()` and `Draw.queue_point()` to `Draw.pixel()` and `Draw.queue_pixel()`

Added

- `Events.JOYSTICKCONNECT` and `Events.JOYSTICKDISCONNECT` events, and appropriate response objects.
- `surface.save_as()` and `raster.save_as()` methods to save a surface or raster to a file.
- `scene.on_switch()` overridable method that is called automatically when the scene is switched to.
- `hitbox.on_enter()` overridable method that is called automatically when a hitbox enters a collision.
- `Text` support for anisotropic filtering
- `Display` Maximize, Minimize, and Restore methods.

Changed

- Default physics fps to 50 to be consistent with Unity.
- `Color.from_hex()` now supports many different hex formats.
- `Image` can now be created with an empty string. This is needed when cloning.
- `Scene` and `Group` remove functions can now take in multiple items like the add functions.

Fixed

- Adding groups and gameobjects adds them at the end of a frame instead of in the middle of one.
- `Rectangle` and `Circle` now raise errors when provided with incorrect parameters.
- `Display.save_screenshot()` wasn't working correctly on MacOS
- `Surface` cloning now clones the alpha and color mod correctly.

0.3.5

Breaking Changes

- Removed `Events.ZOOM` because it was only propagated as a result of user behavior.
- Renamed `ScheduledTask` to `RecurrentTask` and `Time.scheduled_call()` to `Time.recurrent_call()`.
- Reordered the arguments of `RecurrentTask`, `FramesTask`, and `DelayedTask` to be more intuitive.
- Removed `is_stopped` from the init arguments of above task constructors to simplify them.
- Removed `Debug` class.
- Switch from the SDL coordinate system to the cartesian coordinate system.
- Centered drawing to `Surface`s and made them cartesian.

Added

- `rigidbody.stop()` method to quickly set the rigidbody velocity to 0.
- `EventResponse` and subclasses for individual rubato events
- `Animation` now has an alpha that can be set.
- `argb` variants of `Color.from_rgba32()` and `color.rgba32()`.
- Python 3.11 support.

Changed

- `RecurrentTask` task callback can now be made to take in a task argument. This allows you to stop the task when you
want.
- `delay` argument in Frame, Delayed, and Recurrent tasks now only controls the delay.
- Frame, Delayed, and Recurrent tasks no longer modify `delay`, and instead determine the next time to run the task
using `next_run`.
- All event listener callbacks now can take in an `EventResponse`.
- Made `Events` an enum for nicer documentation. Doesn't impact usage.
- Internal file structure. Shouldn't impact most users.
- Optimized and fixed some internal rendering algorithms.
- Colors are now internally represented as argb32 integers instead of rgba32 integers.
- `hitbox.get_aabb()` methods now return the aabb in the form of bottom-left, top-right coordinates instead of
top-left, bottom-right.

Removed

- Hidden `rigidbody.physics()` because it is called automatically.
- Hidden `Radio.handle()` because it is called automatically.

Fixed

- Fixed border-thickness not being taken into account when making surfaces in `Draw` methods.
- Turning blending off in surface drawing methods affecting antialias border blending.
- Potential division by 0 error when drawing under certain conditions.

0.3.4

Breaking Changes

- Changed the type of some scale parameters from a scalar value to a Vector/tuple for more customization and
consistency.
- `shadow_pad` parameter in `Draw.text()` is now a vector to allow for different padding in the x and y directions.
- Renamed `surface.merge()` and `raster.merge()` to `surface.blit()` and `raster.blit()`, respectively, to be more
consistent with Unity's API.

Added

- Extra arguments to `raster.blit()` to allow for the full functionality of `surface.blit()`.

Changed

- Removed sdlgfx dependency, replacing them with a cache-based `Surface` implementation.
- Default z-index for all queue-based `Draw` functions is now 0 to match the rest of rubato. (was Math.INF)
- All `Draw` functions can now take in a camera as an optional argument.
- `Text` component now uses a Surface in its implementation.

Removed

- `Draw.texture()` and `Draw.queue_texture()` because they used SDL_Texture objects which are hidden in rubato.
- Hidden a few functions that deal with internal SDL objects that were not user-usable anyway.

Fixed

- Some drawing processes weren't taking into account zoom and the camera's z-index.
- Potential memory leak issue with naked `Font` objects.

0.3.3

Breaking Changes

- Renamed `Draw.surf()` and `Draw.queue_surf()` to `Draw.surface()` and `Draw.queue_surface()`.
- Removed all `delete()` functions because they did nothing that was useful for memory management, which was their
purpose.
- Removed `Sprite`, because `Surface` does the same thing.
- `Display.update()` and `Draw.text()` now use center position like the rest of rubato.
- Removed `PressStart2P` font and replaced it with `Mozart`.

Added

- `ParticleSystem`, which manages a system of `Particles`.
- `remove()` functions where needed.
- `Surface.from_file()` as a replacement for `Sprite`.
- `shadow` option when drawing text.
- A few miscellaneous `str` and `repr` methods where most likely to be used.

Changed

- Made `animation.anim_frame()` a function instead of a property method.
- Renamed `surface.generate_tx()` to `surface.regen()`.
- Renamed `animation.set_current_state()` to `animation.set_state()`.
- Internally use `round()` more often instead of `int()` to avoid rounding errors.
- `button` attribute of mouse events is now an integer instead of a string to be consistent.

Removed

- `animation.image` because it exposed an underlying SDL surface, which should not be seen by users.
- Long deprecated mouse methods in `Input`
- `vector.distance_between` (use `vector.dist_to()`).
- `camera` argument from some draw methods to be consistent.

Fixed

- Returned `NotImplemented` object instead of raising an error for vector math methods.
- FPS drawing correctly on smaller resolutions
- Some `repr` methods not returning a string capable of recreating the object.
- SDL dlls are now properly bundled on _every_ major platform.

0.3.2

Breaking Changes

- `Polygon`s MUST take in a list of vectors in clockwise order instead of counter-clockwise as was before. Generator
methods automatically reflect this change but if you are passing in your own lists, make sure to reflect this
change.
- `component.true_z()` is now a function instead of a property method. This is to match with our new property method
convention.

Added

- `gameobject.remove_ind()` method to remove an individual component from a game object with a given index. Use this
to remove components from a game object which holds multiple instances of the same type of component.
- `component.true_pos()` and `component.true_rotation()` methods to get the position and rotation of a component in
world space. These functions correctly apply the gameobjects position and rotation to the component while respecting
offsets.
- `Vector.poly()` and `Vector.rect()` methods to generate lists of vertices for regular polygons and rectangles.
- `color.clone()`.
- Functions that required Vectors before now accept appropriately-sized tuples.
- `Events.MOUSEWHEEL` and `Events.SCROLL` (which are the same), propagating mouse scroll events.
- `GameObject`s and `Group`s can now be hidden in order to make their children not draw.
- `GameObjects`s can be active just like groups.
- Allowing passing in the hidden attribute into `Component` constructors.
- `Raster.fill()` and `Surface.fill()`.
- `vector.within()` method to check if vector is within a certain distance of another vector.
- `Raster` component and `Surface` now have a changeable alpha. (`Image` and `Sprite` by extension)

Changed

- Modified the internal workings of `gameobject`s components data structure to more flexibly handle inputs. (Can now
handle getting components by a parent type (such as Hitbox or Component or even object)).
- Renamed `vector.distance_between()` to `vector.dist_to()`.
- Renamed `polygon.translated_verts()` to `polygon.offset_verts()`.
- Renamed `polygon.real_verts()` to `polygon.true_verts()` to maintain naming consistency.
- Rewrote `Rectangle` from the ground-up.
- Window is now shown when begin is called. Not when init is called.
- `mouse_button` key passed in mouse press events renamed to `button`
- Default physics fps to 50 to align with Unity.
- Automatically normalized joystick events/getters to be in the range of -1 to 1 instead of -32768 to 32767.

Removed

- `hitbox.get_obb()` because it wasn't working properly. Use `hitbox.get_aabb()` instead.
- `polygon.transformed_verts()` because it was unused in the engine.
- `camera.scale()`. Simply multiply by the zoom instead.
- `Surf`, moving its functionality to `Surface` and updating `Raster` and `Image` accordingly.

Fixed

- Getting `Rectangle`, `Polygon`, or `Circle` components from a gameobject returning all `Hitbox` type objects. You
can still replicate this functionality by passing `Hitbox` into the component getter.
- Offsets (including rotational) not working properly. Physics has also been refactored to handle scaling properly.
- `Rectangle` side getters and setters, which were not utilizing offsets properly. They now work with the AABB of the
rectangle.
- `gameobject.active` not functioning properly.
- Bug fixing from bugs found through pyright.
- `Time.delta_time` being misused in a couple rigidbody methods.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.