Summary | How to control (or Understand) your GIST page's files list order. |
Notice | not official documentation. |
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
@tool | |
extends Node2D | |
@export var radius = 50.0: | |
set(value): | |
radius = value | |
queue_redraw() | |
@export var start_angle_deg = 0.0: | |
set(value): |
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
@tool | |
class_name Circle2D extends Polygon2D | |
@export_range(0.0, 360.0, 0.001, "or_greater", "or_less") var start_degree: float = 0.0: | |
set(value): | |
start_degree = _wrap_degree(value) | |
queue_update() | |
@export_range(0.0, 360.0, 0.001, "or_greater", "or_less") var end_degree: float = 360.0: | |
set(value): |
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
class_name ColorUtil extends Object | |
static func parse_html(rgba_or_preset: String, ignore_alpha: bool = false, default_color: Variant = null) -> Color: | |
var color: Variant = PRESET.get(rgba_or_preset.to_upper()) | |
if color == null and Color.html_is_valid(rgba_or_preset): | |
color = Color.html(rgba_or_preset) | |
if color == null: | |
return default_color |
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
func eval(code: String) -> Error: | |
var script := GDScript.new() | |
script.source_code = "static func _static_init(): pass; " + code.strip_edges().replace("\n", ";") | |
return script.reload() |
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
## Generic wrapper for holding any value. | |
## Allows passing a value between functions by reference instead of value (copy). | |
class_name ValueHolder extends RefCounted | |
## Triggers when value is updated. Current and previous values are passed. | |
signal changed(value: Variant, last_value: Variant) | |
## Current value. Changing this value will emit changed() signal. | |
var value: Variant: | |
set(new_value): |
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
@tool | |
extends EditorScript | |
# Align selected Node2Ds to current mouse position. | |
# Ctrl+Shift+X to run. | |
func _run(): | |
var editor_interface = get_editor_interface() | |
var mouse_position = editor_interface.get_editor_viewport_2d().get_mouse_position() | |
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
// Twitch Javascript injected script to simulate reward redemption. | |
// Note: Class names may need to be changed if outdated. | |
// Index of reward to click. | |
var rewardButtonIndex = 0 | |
var amountOfRedeems = 1 | |
// Class names for elements. | |
var rewardsListButtonClass = "ScCoreButton-sc-ocjdkq-0 ScCoreButtonText-sc-ocjdkq-3 ljgEdo fuXDrj" | |
var specificRewardButtonClass = "ScInteractableBase-sc-ofisyf-0 ScInteractableDefault-sc-ofisyf-1 dsnvLR etibmD tw-interactable" |
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
@tool | |
extends Node2D | |
@export var show_number: bool = false: | |
set(value): | |
show_number = value | |
notify_property_list_changed() | |
@export var editable_number: bool = false: | |
set(value): |
NewerOlder