Skip to content

Instantly share code, notes, and snippets.

@BrastenXBL
BrastenXBL / looping_box_containers.tscn
Created May 3, 2025 21:57
Very simple looping BoxContainer Godot 4.4.1
[gd_scene load_steps=11 format=3]
[sub_resource type="GDScript" id="GDScript_oklhg"]
script/source = "extends VBoxContainer
func _on_forward_button_pressed():
move_child(get_child(0),-1)
func _on_back_button_pressed():
move_child(get_child(-1),0)
@BrastenXBL
BrastenXBL / scrolling_background.tscn
Created March 31, 2025 04:21
ScrollingBackground Menu Godot 4.4
[gd_scene load_steps=3 format=3]
[sub_resource type="Gradient" id="Gradient_55y5s"]
offsets = PackedFloat32Array(0, 0.498411, 1)
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_7yxsr"]
gradient = SubResource("Gradient_55y5s")
width = 960
height = 540
@BrastenXBL
BrastenXBL / example_patterned_progress_bars.tscn
Created February 11, 2025 21:10
Patterned Colored Progress Bars for Godot 4.3
[gd_scene load_steps=17 format=3]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vq0ld"]
[sub_resource type="GDScript" id="GDScript_f68c0"]
script/source = "extends ProgressBar
@export_range(0.0,2.0) var value_rate = 0.5
@export var value_color_high := Color.GREEN
@export var value_color_mid := Color.GOLD
@BrastenXBL
BrastenXBL / example_inventory.tscn
Created February 7, 2025 01:23
An example Godot GUI Inventory using Grid and HFlow
[gd_scene load_steps=3 format=3]
[sub_resource type="Gradient" id="Gradient_4stxq"]
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ujm64"]
gradient = SubResource("Gradient_4stxq")
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
@BrastenXBL
BrastenXBL / timed_spawner.gd
Created January 26, 2025 04:58
A simple timed spawner for Godot 4.3 3D
class_name TimedSpawner3D
extends Marker3D
## Drag the enemy or object .tscn that will be copied, instantiated
@export var spawn_scene : PackedScene
# This is making it easier to customize, and passes through to the Timer node.
## Scene will only spawn once if this is turned on.
@export var one_shot_spawn : bool = false
@BrastenXBL
BrastenXBL / pixel_game_with_gui_hd.tscn
Created July 14, 2024 05:21
An example of setting up a Godot scene for a Pixel game with higher resolution GUI.
[gd_scene load_steps=5 format=3]
[sub_resource type="Gradient" id="Gradient_8q6eo"]
offsets = PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)
colors = PackedColorArray(0, 0, 0, 1, 1, 0, 0, 1, 1, 0.6, 0, 1, 0.8, 1, 0, 1, 0.2, 1, 0, 1, 0, 1, 0.4, 1, 0, 1, 1, 1, 0, 0.4, 1, 1, 0.2, 0, 1, 1, 1, 0, 0.6, 1, 1, 0, 0.0166664, 1)
metadata/_snap_enabled = true
[sub_resource type="GradientTexture2D" id="GradientTexture2D_qsl38"]
gradient = SubResource("Gradient_8q6eo")
width = 160
Getting better help -video, and a form to fill to format the request.
https://www.youtube.com/watch?v=HBJg1v53QVA , https://school.gdquest.com/guides/get_answers
A general Bug Report template, fill as many as apply:
Godot Version:
Render Mode:
@BrastenXBL
BrastenXBL / ae.gd
Created July 5, 2024 00:50
An Autoload hack for Godot Android editor to pre-test for NULL crashes.
class_name GodotAndroidEditorRuntimeErrorDebugger
extends Node
## Singleton(Autoload) containing global helper methods for the Android Editor.
##
## This class is intended to be used as a Singleton(Autoload), the [code]gdaererrd[/code] plug-in will
## automatically add [code]aerr[/code] as an Autoload. The Singleton name and method names are
## intended for easy typing on QWERTY digital keyboards found on phones and tablets.[br]
## [br]
## Use [code]aerr.t(arg)[/code] to test if a single variable is_instance_valid().[br]
## Failure will cause the program to print the error to console Output.
extends Button #replace with other BaseButton classes as needed
@export var action : StringName
@export var feedback : bool = true
func _input(event):
if event.is_action_pressed(action):
accept_event()
var toggle_mode_default
if feedback: