Skip to content

Simplify & fix AntialiasedRegularPolygon2D angle#13

Open
razcore-rad wants to merge 7 commits intogodot-extended-libraries:masterfrom
razcore-rad:master
Open

Simplify & fix AntialiasedRegularPolygon2D angle#13
razcore-rad wants to merge 7 commits intogodot-extended-libraries:masterfrom
razcore-rad:master

Conversation

@razcore-rad
Copy link

@razcore-rad razcore-rad commented Dec 4, 2025

  • Generate the AA texture with generate_antialiased_texture.gd as a binary resource and save it to disk instead of in-memory. Stops Godot from complaining that the scene files using these custom nodes are too large.
  • Simplify code by reusing classes.
  • Other defaults and shuffle code around. For example we usually rewrite _ready(), so instead of remembering to call super(), moved all relevant property assignments to _init() instead.
  • Made the Line2D an internal node.
  • Rename regular polygon 2D angle_degrees to arc.
  • Fix issue with arc not spanning the correct angle.
  • Other export QoL like arc showing in degrees, but value being radians, etc.

See images for arc fix.
image
vs
image

- Generate the AA texture with `generate_antialiased_texture.gd` as a
binary resource and save it to disk instead of in-memory. Stops Godot
from complaining that the scene file is too large.
- Simplify code by reusing classes.
- Other defaults and shuffle code around. For example we usually rewrite
`_ready()`, so instead of remembering to call `super()`, moved all
relevant property assignments to `_init()` instead.
- Made the `Line2D` an internal node.
- Rename regular polygon 2D `angle_degrees` to `arc`.
- Fix issue with `arc` not spanning the correct angle.
- Other export QoL like `arc` showing in degrees, but value being
radians, etc.
@razcore-rad
Copy link
Author

Also fixes #12, and started the regular polygon from X-axis instead of Y. Even if the rotation is inverted (goes down with positive angle), it's closer to how we think of angles from math.

fix godot-extended-libraries#12 by updating stroke using `draw` signal instead of handling
updates in `_set()`
@Calinou Calinou added bug Something isn't working enhancement New feature or request labels Dec 4, 2025
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing. Code looks good to me.

Can you remove top-level files? There is already a demo project in a separate repository: https://github.com/godot-extended-libraries/godot-antialiased-line2d-demo

(It's kept separate so that it can be listed separately in the asset library, and to avoid installing unneeded files in projects.)

@razcore-rad
Copy link
Author

Oh, for some reason I thought that the top-level files don't show up for installation, I thought only what's under addons/ does. Probably because I've been using gd-plug addon for managing other addons.

I'll get to cleaning the PR up, although I'll put it on DRAFT for now because I have more work on it, just found out a few days ago about _property_can_revert() & _property_get_revert() so I have plans for a better in-editor workflow, but I need to do some testing.

@razcore-rad razcore-rad marked this pull request as draft January 23, 2026 09:22
Since `_is_instantiated` is only updated propertly in `_ready()` I
reverted all scripts to using `_ready()` instead of `_init()` to be
symetrical and not have `AntialiasedLine2D` the only odd one with
potentially both `_init()` & `_ready()` or just `_ready()`.

- removed commented out code from `plug.gd`
- removed top-level files
- added `AntialiasedLine2D` revert defaults for built-in `texture`,
`texture_mode` & `texture_filter` properties
@razcore-rad razcore-rad marked this pull request as ready for review January 23, 2026 10:37
@razcore-rad
Copy link
Author

Alright, all should be checked and ready for merge. Check the commit message for more details

@razcore-rad razcore-rad requested a review from Calinou January 23, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants