Skip to content

Instantly share code, notes, and snippets.

@AnidemDex
AnidemDex / EditorTricks.md
Last active February 26, 2024 09:22
Some editor tricks that I’ve compiled from time to time

Editor Tricks

Drag and drop data

Editor tell other nodes what data is going to be passed throug some structs that are are converted to dictionaries.

These structs usually have this format:

{type, value, origin}
@AnidemDex
AnidemDex / recursive.gd
Created August 28, 2022 03:03
A little snippet to do task in big loops between frames to avoid hanging the engine
## Emmited when the process start.
## Is a good idea to update your nodes according to
## the generated total_steps
signal started()
## Emmited when the process ends.
signal ended()
## Emmited everytime the processor reach the chunk limit and will start
## another chunk of load.
@AnidemDex
AnidemDex / flow_container.gd
Last active April 24, 2022 16:27
Node Container that wraps its childs nodes in its rect
tool
extends Container
#class_name FlowContainer
## Modified version of
## https://github.com/godotengine/godot/pull/56104 to be used in versions previous 3.5
## by AnidemDex
## Use it as you want
@AnidemDex
AnidemDex / texalog_character_events_demo.gd
Created November 24, 2021 17:03
How to use character events by code demostration
extends Node
func _ready() -> void:
var tmln := Timeline.new()
var eve1 := EventCharacterJoin.new()
var eve2 := EventCharacterChangeExpression.new()
var eve3 := EventCharacterLeave.new()
var eve4 := EventWait.new()
eve4.wait_time = 4
#include <NewPing.h>
/*Aqui se configuran los pines donde debemos conectar el sensor*/
#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define MAX_DISTANCE 200
/*Crear el objeto de la clase NewPing*/
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);