-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add anti alias support for linear Canvasitem draw primitives #84497
Closed
xiongyaohua
wants to merge
2
commits into
godotengine:master
from
xiongyaohua:canvasitem_draw_antialiased
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,8 +76,14 @@ | |
<param index="0" name="position" type="Vector2" /> | ||
<param index="1" name="radius" type="float" /> | ||
<param index="2" name="color" type="Color" /> | ||
<param index="3" name="filled" type="bool" default="true" /> | ||
<param index="4" name="width" type="float" default="-1.0" /> | ||
<param index="5" name="antialiased" type="bool" default="false" /> | ||
<description> | ||
Draws a colored, filled circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon]. | ||
Draws a circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon]. | ||
If [param filled] is [code]true[/code], the cricle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the circle will be drawn as a stroke with the [param color] and [param width] specified. | ||
If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. | ||
[b]Note:[/b] [param width] and [param antialiased] is only effective if [param filled] is [code]false[/code]. | ||
</description> | ||
</method> | ||
<method name="draw_colored_polygon"> | ||
|
@@ -98,9 +104,11 @@ | |
<param index="3" name="width" type="float" default="-1.0" /> | ||
<param index="4" name="dash" type="float" default="2.0" /> | ||
<param index="5" name="aligned" type="bool" default="true" /> | ||
<param index="6" name="antialiased" type="bool" default="false" /> | ||
<description> | ||
Draws a dashed line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. | ||
If [param width] is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. | ||
[b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. | ||
</description> | ||
</method> | ||
<method name="draw_end_animation"> | ||
|
@@ -168,19 +176,23 @@ | |
<param index="0" name="points" type="PackedVector2Array" /> | ||
<param index="1" name="color" type="Color" /> | ||
<param index="2" name="width" type="float" default="-1.0" /> | ||
<param index="3" name="antialiased" type="bool" default="false" /> | ||
<description> | ||
Draws multiple disconnected lines with a uniform [param width] and [param color]. Each line is defined by two consecutive points from [param points] array, i.e. i-th segment consists of [code]points[2 * i][/code], [code]points[2 * i + 1][/code] endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead. | ||
If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. | ||
[b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. | ||
</description> | ||
</method> | ||
<method name="draw_multiline_colors"> | ||
<return type="void" /> | ||
<param index="0" name="points" type="PackedVector2Array" /> | ||
<param index="1" name="colors" type="PackedColorArray" /> | ||
<param index="2" name="width" type="float" default="-1.0" /> | ||
<param index="3" name="antialiased" type="bool" default="false" /> | ||
<description> | ||
Draws multiple disconnected lines with a uniform [param width] and segment-by-segment coloring. Each segment is defined by two consecutive points from [param points] array and a corresponding color from [param colors] array, i.e. i-th segment consists of [code]points[2 * i][/code], [code]points[2 * i + 1][/code] endpoints and has [code]colors[i][/code] color. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead. | ||
If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. | ||
[b]Note:[/b] [param antialiased] is only effective if [param width] is greater than [code]0.0[/code]. | ||
</description> | ||
</method> | ||
<method name="draw_multiline_string" qualifiers="const"> | ||
|
@@ -276,10 +288,11 @@ | |
<param index="1" name="color" type="Color" /> | ||
<param index="2" name="filled" type="bool" default="true" /> | ||
<param index="3" name="width" type="float" default="-1.0" /> | ||
<param index="4" name="antialiased" type="bool" default="false" /> | ||
<description> | ||
Draws a rectangle. If [param filled] is [code]true[/code], the rectangle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the rectangle will be drawn as a stroke with the [param color] and [param width] specified. See also [method draw_texture_rect]. | ||
If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. | ||
[b]Note:[/b] [param width] is only effective if [param filled] is [code]false[/code]. | ||
[b]Note:[/b] [param width] and [param antialiased] is only effective if [param filled] is [code]false[/code]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is -> are |
||
[b]Note:[/b] Unfilled rectangles drawn with a negative [param width] may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent [param color]). | ||
</description> | ||
</method> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is -> are