Skip to content

Instantly share code, notes, and snippets.

class_name Utils
static func file_exists_(prespath:String, pforceexactmatch:bool=false)->bool:
if prespath.begins_with('res://') and not pforceexactmatch:
return FileAccess.file_exists(prespath) or FileAccess.file_exists(prespath+'.remap') or FileAccess.file_exists(prespath+'.import')
else:
return FileAccess.file_exists(prespath)
@Gnumaru
Gnumaru / GdscriptCallSequence.txt
Last active March 19, 2024 03:00
The sequence in which methods and signals gets called in gdscript
# as of godot 4.1
_static_init
_init
_notification 20 Node.NOTIFICATION_SCENE_INSTANTIATED # only on instantiated scene roots
_notification 18 Node.NOTIFICATION_PARENTED
_enter_tree
tree_entered signal
_notification 27 Node.NOTIFICATION_POST_ENTER_TREE
_ready
ready signal
@Gnumaru
Gnumaru / CompactEditorTheme.tres
Last active September 21, 2023 20:54
An editor theme for godot that reduces a bit of the wasted space
[gd_resource type="Theme" load_steps=3 format=2]
[sub_resource type="Image" id=3]
data = {
"data": PackedByteArray( 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 1,
"mipmaps": false,
"width": 1
}
@Gnumaru
Gnumaru / ScriptTester.gd
Created August 13, 2023 14:52
"Test" scripts by loading them
# ScriptTester.tscn
# ScriptTester.gd
@tool
extends Node
@export var mtool_do_test_scripts:bool:
get: return false
set(p):
mtool_do_test_scripts = false
if p: tool_do_test_scripts()
func _ready():
@Gnumaru
Gnumaru / gist:e1e88d146334aac84ab6530c150928f1
Created September 14, 2019 18:10
transcription for the code found in the video "PyQt5 Creating Paint Application In 40 Minutes" https://www.youtube.com/watch?v=qEgyGyVA1ZQ
# transcription for the code found in the video "PyQt5 Creating Paint Application In 40 Minutes" https://www.youtube.com/watch?v=qEgyGyVA1ZQ
from PyQt5.QtWidgets import QApplication, QMainWindow, QMenuBar, QMenu, QAction, QFileDialog
from PyQt5.QtGui import QIcon, QImage, QPainter, QPen
from PyQt5.QtCore import Qt, QPoint
import sys
class Window (QMainWindow) :
def __init__(self):
super().__init__()