FastJ icon indicating copy to clipboard operation
FastJ copied to clipboard

[Feature Request] Massively overhaul Drawable classes

Open lucasstarsz opened this issue 3 years ago • 4 comments

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

  • Overhaul psdf contents
    • [x] Add support for gradients
    • [x] #110
    • [x] Add outline/stroke support
    • [x] #109
  • [ ] Support read/write with the svg format
  • [x] Support read/write with the obj format

Text2D

  • [ ] Improve Text2D with vector graphics/attribute modifiers
  • [ ] Support to read/write Text2D to tsdf/svg

Polygon2D

  • [x] Improve Polygon2D with more paint options/outline options
  • [x] Add extra options for working with complex curves (beziers)
  • [x] Add option to create Polygon2D from Path2D instance

Drawable

  • [ ] Add child/parent system
  • [ ] Store Scene reference in each Drawable
  • [x] Abstract transform implementations -- see #12

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.

lucasstarsz avatar Apr 23 '21 02:04 lucasstarsz

Perhaps a function or class to set a certain pixel on screen (hopefully will be more performant than drawing a 1x1 rect). Ability to draw arcs (psdf support and Polygon2D support).

Also is it feasible to add a Polygon2D constructor that takes a Path2D?

nt314p avatar Apr 25 '21 19:04 nt314p

Perhaps a function or class to set a certain pixel on screen (hopefully will be more performant than drawing a 1x1 rect).

I can't currently guarantee that this will be very performant, unfortunately, but I think it would be worth a shot.

Ability to draw arcs (psdf support and Polygon2D support).

This is included (but not specified -- my bad!) with the improvements all around for the Polygon2D class and model loading.

Also is it feasible to add a Polygon2D constructor that takes a Path2D?

Totally! I personally might end up making it a static method that reads like so: Polygon2D polygon = Polygon2D.fromPath(path2d); Hopefully that ends up working out for you.

lucasstarsz avatar Apr 26 '21 12:04 lucasstarsz

Note: the drawable-improvement branch has been replaced with the drawable branch.

lucasstarsz avatar Jul 11 '21 22:07 lucasstarsz

Also is it feasible to add a Polygon2D constructor that takes a Path2D?

@nt314p Finally got around to doing this one. Still on the fence about working with arcs, points, and lines, but we've got one completely added (see #205)! Hope this helps 👍🏾

lucasstarsz avatar May 09 '22 07:05 lucasstarsz