-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Massively overhaul Drawable classes #10
Comments
Perhaps a function or class to set a certain pixel on screen (hopefully will be more performant than drawing a 1x1 rect). Also is it feasible to add a Polygon2D constructor that takes a Path2D? |
I can't currently guarantee that this will be very performant, unfortunately, but I think it would be worth a shot.
This is included (but not specified -- my bad!) with the improvements all around for the Polygon2D class and model loading.
Totally! I personally might end up making it a static method that reads like so: |
New Additions: - PsdfUtil: - Derivation from DrawUtil for working with `.psdf` files. - Added support for saving `RadialGradient` and `LinearGradient` to a psdf file - Polygon2D -- Changed `color` variable to `paint` to support all types of `Paint` objects. - DrawUtil - Moved psdf content to PsdfUtil - `paintEquals` method for comparing equality between two `Paint` objects. - Changed `randomFont` method to draw font names from the original font set. - Added methods to generate random linear/radial gradients: - `randomLinearGradient` - `randomLinearGradientWithAlpha` - `randomRadialGradient` - `randomRadialGradientWithAlpha` Files Moved: - `tech.fastj.graphics.DisplayUtil.java` → `tech.fastj.graphics.util.DisplayUtil.java` - `tech.fastj.graphics.DrawUtil.java` → `tech.fastj.graphics.util.DrawUtil.java` - `tech.fastj.graphics.util.GradientBuilder.java` → `tech.fastj.graphics.util.gradients.GradientBuilder.java` - `tech.fastj.graphics.util.Gradients.java` → `tech.fastj.graphics.util.gradients.Gradients.java` - `tech.fastj.graphics.util.LinearGradientBuilder.java` → `tech.fastj.graphics.util.gradients.LinearGradientBuilder.java` - `tech.fastj.graphics.util.RadialGradientBuilder.java` → `tech.fastj.graphics.util.gradients.RadialGradientBuilder.java`
- Added constructors that don't require translation parameters, and constructors that allow initial scale/rotation.
- Added constructors that don't require translation parameters, and constructors that allow initial scale/rotation.
With the addition of outline rendering, the boolean determining fill or outline was no longer satisfactory. As such, the `RenderStyle` class was created, defining the different options for rendering (Only `Polygon2D` has this so far, but it will be rolled out to other classes as needed.) Additions - `Polygon2D#renderStyle` - the replacement to the aforementioned boolean which determines if objects should be filled, outlined, or both. Corresponding default is `Polygon2D#DefaultRenderStyle`. - `Polygon2D#outlineStroke` - the `java.awt.BasicStroke` representing the style of the outline. Corresponding default is `Polygon2D#DefaultStroke`. - `Polygon2D#outlineColor` - the `java.awt.Color` representing the color of the outline. Corresponding default is `Polygon2D#DefaultOutlineColor`. Breaking Changes - Removed all but one `Polygon2D` constructor and made it package private - Included are `create` methods that call on a `Polygon2DBuilder` class which will be added in the next commit. This will replace the excessive amounts of constructors that would have eventually arisen. - Removed `Polygon2D#DefaultFill` and `Polygon2D#shouldFill`, in accordance with the information at the beginning of the commit message. - Renamed `Polygon2D#get/setPaint` to `get/setFill` Removals - Removed transform information from `Polygon2D#toString` - Removed `Polygon2D#DefaultShow`
New Additions: - Polygon2D now properly supports outlines (BasicStroke only) - revamped ModelUtil (PsdfUtil → ModelUtil) - Added outline, render style, and transform support - Refractored code to allow for later support for more file formats Breaking Changes: - Removed public access to all `Polygon2D` constructors. `Polygon2D`s must now be created using `Polygon2D#create`, which corresponds to a `Polygon2DBuilder` instance. - Renamed `PsdfUtil#loadPsdf` → `ModelUtil#loadModel` & `PsdfUtil#writePsdf` → `ModelUtil#writeModel` to better represent what the methods do.
Bug Fixes: - Add `break` statements to `PsdfUtil#writeRenderStyle` switch statement to prevent incorrect render style writing - Fix issue with trying to parse floats in `PsdfUtil#parseOutlineStroke` - Remove values stream to prevent stream re-usage in `SupportedFileFormats` - Fix issue with only setting part of the render style content in `Polygon2DBuilder#build` New Additions: - Add method to create a random outline stroke
With the addition of outline rendering, the boolean determining fill or outline was no longer satisfactory. As such, the `RenderStyle` class was created, defining the different options for rendering (Only `Polygon2D` has this so far, but it will be rolled out to other classes as needed.) Additions - `Polygon2D#renderStyle` - the replacement to the aforementioned boolean which determines if objects should be filled, outlined, or both. Corresponding default is `Polygon2D#DefaultRenderStyle`. - `Polygon2D#outlineStroke` - the `java.awt.BasicStroke` representing the style of the outline. Corresponding default is `Polygon2D#DefaultStroke`. - `Polygon2D#outlineColor` - the `java.awt.Color` representing the color of the outline. Corresponding default is `Polygon2D#DefaultOutlineColor`. Breaking Changes - Removed all but one `Polygon2D` constructor and made it package private - Included are `create` methods that call on a `Polygon2DBuilder` class which will be added in the next commit. This will replace the excessive amounts of constructors that would have eventually arisen. - Removed `Polygon2D#DefaultFill` and `Polygon2D#shouldFill`, in accordance with the information at the beginning of the commit message. - Renamed `Polygon2D#get/setPaint` to `get/setFill` Removals - Removed transform information from `Polygon2D#toString` - Removed `Polygon2D#DefaultShow`
New Additions: - Polygon2D now properly supports outlines (BasicStroke only) - revamped ModelUtil (PsdfUtil → ModelUtil) - Added outline, render style, and transform support - Refractored code to allow for later support for more file formats Breaking Changes: - Removed public access to all `Polygon2D` constructors. `Polygon2D`s must now be created using `Polygon2D#create`, which corresponds to a `Polygon2DBuilder` instance. - Renamed `PsdfUtil#loadPsdf` → `ModelUtil#loadModel` & `PsdfUtil#writePsdf` → `ModelUtil#writeModel` to better represent what the methods do.
Bug Fixes: - Add `break` statements to `PsdfUtil#writeRenderStyle` switch statement to prevent incorrect render style writing - Fix issue with trying to parse floats in `PsdfUtil#parseOutlineStroke` - Remove values stream to prevent stream re-usage in `SupportedFileFormats` - Fix issue with only setting part of the render style content in `Polygon2DBuilder#build` New Additions: - Add method to create a random outline stroke
With the addition of outline rendering, the boolean determining fill or outline was no longer satisfactory. As such, the `RenderStyle` class was created, defining the different options for rendering (Only `Polygon2D` has this so far, but it will be rolled out to other classes as needed.) Additions - `Polygon2D#renderStyle` - the replacement to the aforementioned boolean which determines if objects should be filled, outlined, or both. Corresponding default is `Polygon2D#DefaultRenderStyle`. - `Polygon2D#outlineStroke` - the `java.awt.BasicStroke` representing the style of the outline. Corresponding default is `Polygon2D#DefaultStroke`. - `Polygon2D#outlineColor` - the `java.awt.Color` representing the color of the outline. Corresponding default is `Polygon2D#DefaultOutlineColor`. Breaking Changes - Removed all but one `Polygon2D` constructor and made it package private - Included are `create` methods that call on a `Polygon2DBuilder` class which will be added in the next commit. This will replace the excessive amounts of constructors that would have eventually arisen. - Removed `Polygon2D#DefaultFill` and `Polygon2D#shouldFill`, in accordance with the information at the beginning of the commit message. - Renamed `Polygon2D#get/setPaint` to `get/setFill` Removals - Removed transform information from `Polygon2D#toString` - Removed `Polygon2D#DefaultShow`
Bug Fixes: - Add `break` statements to `PsdfUtil#writeRenderStyle` switch statement to prevent incorrect render style writing - Fix issue with trying to parse floats in `PsdfUtil#parseOutlineStroke` - Remove values stream to prevent stream re-usage in `SupportedFileFormats` - Fix issue with only setting part of the render style content in `Polygon2DBuilder#build` New Additions: - Add method to create a random outline stroke
Note: the |
Images, Sprites, Animations, and a lot more Additions - (#104) added Linux's X11 to list of supported hardware accelerations - (#108) Added Sprite2D and simple animation system - Manages an array of sprites, as well as an image resource instance - has default animations for "continuous", "play to end", and "static" (default is "continuous") - (#113) Added centralized, extensible resource manager - (#108, #113) Added image resource manager implementation - (#108) Added `ImageUtil` to load and manage buffered images (makes use of resource manager where needed) - (#113) Added default resource management, loaded on `FastJEngine` static initialization (_before_ `FastJEngine.init`!) - (#10, #110) added `TexturePaint` builder, and support for `TexturePaint` in `.psdf` files - (#10) Added support for writing/parsing `Model2D` to the `.obj`/`.mtl` file format Bug Fixes - (Fixes #106) Fixed translation doubling by removing translation from `setMetrics` method calls - (Fixes #114) Added missing call to `Scene.reset` for each scene in `SceneManager` during a call to `SceneManager.reset`. - (Fixes #115) Added calls to destroy `Drawable`s in `Scene`/`SimpleManager` - (Fixes #86) Fixed issue where occasional `ConcurrentModificationException`s woulc crop up thanks to slight issues with consistent multithreaded/event-based inputs (keyboard, mouse, window, etc). Breaking Changes - Moved `tech.fastj.systems.fio.FileUtil` to `tech.fastj.resources.files.FileUtil` - Moved `tech.fastj.graphics.util.ModelUtil` to `tech.fastj.resources.models.ModelUtil` - Moved `tech.fastj.graphics.io.PsdfUtil` to `tech.fastj.resources.models.PsdfUtil` - Moved `tech.fastj.graphics.io.SupportedModelFormats` to `tech.fastj.resources.models.SupportedModelFormats`
New Additions: - Support for converting Path2D objects with curves and multiple subpaths to Pointf[] arrays (with optional `alternateIndexes` stored in paired `Point[]`) - `DrawUtil#pointsOfPathWithAlt` specifically for getting both the points of the path and indicators of where curves/other path related functions are - Support for writing/reading polygons with curves with .psdf files Breaking Changes: - `DrawUtil#pointsOfPath` and variants no longer throw exceptions on unclosed paths. Bug Fixes: - (minor) Fixed issue in `DrawUtil#createPath` where `altIndexes` was not checked for emptiness Other Changes: - Optimized usages of `Polygon2D#getPoints` to be less taxing for standard tasks
Is your feature request related to a problem? Please describe.
As part of the massive performance, feature, and structural overhaul needed to propel FastJ into 2.0, we need an incredibly strong and flexible foundation. As such, this issue is opened to describe the many things needed in order to consider the engine ready for a more useful UI system, among other things.
What should the solution be like?
This is the list of features currently expected as a bare minimum in order to proceed:
General Model Loading
svg
formatobj
formatText2D
Polygon2D
Drawable
If you have any suggestions for other features, please leave a comment down below explaining. Progress of this will be tracked in the
drawable
branch.The text was updated successfully, but these errors were encountered: