Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
[Brief description ]
- [more description]
- [more description]
- [more description]
| export function ref(initialValue) { | |
| const state = $state({value: initialValue}); | |
| return state; | |
| } | |
| export function watchedRef(initialValue, onSet, onGet) { | |
| let value = $state(initialValue) | |
| return { | |
| set value(newValue) { | |
| const oldValue = value |
| using Godot; | |
| using System; | |
| /// <summary> | |
| /// Margins for Mobile safe area that accounts for cutouts. | |
| /// Also accounts for corner radius. | |
| /// </summary> | |
| [GlobalClass] | |
| public partial class SafeAreaContainer : MarginContainer | |
| { |
| public static partial class PackedSceneExtension | |
| { | |
| public static Variant? GetNodePropertyValue(this PackedScene packedScene, int nodeIndex, StringName propertyName) | |
| { | |
| SceneState sceneState = packedScene.GetState(); | |
| int propertyCount = sceneState.GetNodePropertyCount(nodeIndex); | |
| for (int propertyIndex = 0; propertyIndex < propertyCount; propertyIndex++) | |
| { | |
| if (sceneState.GetNodePropertyName(nodeIndex, propertyIndex) == propertyName) |
| @tool | |
| class_name Trail2D extends Node2D | |
| @export var duration_sec: float = 0.2: | |
| set(value): | |
| _line.clear_points() | |
| _point_times.clear() | |
| duration_sec = value | |
| @export var width: int = 10: |
| using System.Linq; | |
| public static partial class Node2DExtension | |
| { | |
| public static Rect2 GetCalculatedBounds(this Node2D node2D) | |
| { | |
| var rect = new Rect2(); | |
| var children = node2D.GetChildren().ToList(); | |
| while (children.Count > 0) |
| shader_type canvas_item; | |
| uniform vec3 border_color: source_color = vec3(0); | |
| uniform float border_width: hint_range(0, 10) = 0; | |
| uniform bool circle = false; | |
| void fragment() { | |
| float center = 0.5; | |
| float border_width_uv = border_width * min(TEXTURE_PIXEL_SIZE.x, TEXTURE_PIXEL_SIZE.y); | |
| float border_start = center - border_width_uv; |
| shader_type canvas_item; | |
| uniform vec4 border_color: source_color = vec4(1.0); | |
| uniform float border_width: hint_range(0, 10) = 0; | |
| void fragment() { | |
| float border_width_uv = border_width * max(TEXTURE_PIXEL_SIZE.x, TEXTURE_PIXEL_SIZE.y); | |
| if (step(0.5 - border_width_uv, abs(UV.x - 0.5)) == 1.0 || | |
| step(0.5 - border_width_uv, abs(UV.y - 0.5)) == 1.0) { |
| shader_type canvas_item; | |
| uniform vec4 border_color: source_color = vec4(1.0); | |
| uniform float border_width: hint_range(0, 10) = 0; | |
| void fragment() { | |
| float alpha = step(length(UV - vec2(0.5, 0.5)), 0.5); | |
| if (alpha > 0.0) { | |
| float border_width_uv = border_width * max(TEXTURE_PIXEL_SIZE.x, TEXTURE_PIXEL_SIZE.y); | |
| if (step(0.5 - border_width_uv, length(UV - vec2(0.5, 0.5))) == 1.0) { |