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
/////////////////////////////////////////////////////////////////////////////// | |
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader | |
// AUTHOR: Freya Holmér | |
// LICENSE: Use for whatever, commercial or otherwise! | |
// Don't hold me liable for issues though | |
// But pls credit me if it works super well <3 | |
// LIMITATIONS: There's some precision loss beyond 3 decimal places | |
// CONTRIBUTORS: yes please! if you know a more precise way to get | |
// decimal digits then pls lemme know! | |
// GetDecimalSymbolAt() could use some more love/precision |
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
// Copyright (c) 2023 Tomasz Stachowiak | |
// | |
// This contribution is dual licensed under EITHER OF | |
// | |
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0) | |
// MIT license (http://opensource.org/licenses/MIT) | |
// | |
// at your option. | |
#include "/inc/frame_constants.hlsl" |
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
extends Object | |
class_name DrawUtils | |
# Extracted from graph_node.cpp | |
static func draw_cos_line(node : Node, from_position : Vector2, to_position : Vector2, from_color : Color, to_color : Color, bezier_len_pos : int, bezier_len_neg : int, line_width : float = 1.0, shadow : bool = false) -> void: | |
var diff = to_position.x - from_position.x | |
var cp_offset | |
var cp_len = bezier_len_pos | |
var cp_neg_len = bezier_len_neg | |
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
extends Object | |
class_name NodeUtils | |
static func get_child_by_class(node : Node, child_class : String, counter : int = 1) -> Node: | |
var match_counter = 0 | |
var node_children = node.get_children() | |
for child in node_children: | |
if (child.get_class() == child_class): | |
match_counter += 1 |