Skip to content

Instantly share code, notes, and snippets.


Carter Anderson cart

View GitHub Profile
use bevy::prelude::*;
struct Player {
velocity: Vec3,
fn main() {
// Anchors
.spawn(ButtonComponents {
node: Node::with_size(Anchors::CENTER, Size {
material: button_materials.normal,
.with_children(|parent| {
use bevy_ecs::{Changed, Entity, Query, Res, ResMut, With, Without};
use bevy_math::Vec2;
use bevy_render::renderer::RenderResources;
use bevy_transform::prelude::{Children, Parent, Transform};
use bevy_window::Windows;
use std::collections::HashMap;
use stretch::{number::Number, result::Layout, style::Style, Stretch};
#[derive(Debug, Clone, Default, RenderResources)]
pub struct Node {
use std::{fmt::Debug, ops::{Deref, DerefMut}};
pub struct Track<T> {
modified: bool,
value: T,
pub trait Tracker {
fn is_modified(&self) -> bool;
fn reset(&mut self);
View gist:3e77d6537e1a0979a69de5c6749b6bcb
Entity [
Scale { x: 2.0, y: 2.0, z: 2.0 },
PropDemo {
value: "hello",
sequence: [0,1,2],
map: {field: 1.0, hello: "hi"},
nested: {field: [{test: 1.0}]}
// Children entities are nested
View gist:1b97ea56303726eff05fdac41168b9d1
PipelineLayout {
bind_groups: [
BindGroupDescriptor {
index: 0,
bindings: [
BindingDescriptor {
name: "Camera2d",
index: 0,
bind_type: Uniform {
dynamic: false,
cart / FXAA.tscn
Last active Nov 24, 2022
Godot Nvidia FXAA 3.11 Port
View FXAA.tscn
[gd_scene load_steps=3 format=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
// Godot Nvidia FXAA 3.11 Port
// Usage: Drop this in to any 3D scene for FXAA! This is a port of the \"PC High Quality Preset 39\". However the medium quality
// parameters are also included. For medium quality, just comment out sections \"PS 6\" and above and uncomment the \"med 13\" variables.
cart / gist:cc095f4950c40c1fe25169be5ee78247
Created Feb 1, 2018
A collection of C# Math extensions for Godot
View gist:cc095f4950c40c1fe25169be5ee78247
using Godot;
namespace HighHat.MathHelpers
public static class MathExtensions
// TODO: expose Godot's Transform::interpolate_with to scripting. This is just a C# port
public static Transform InterpolateWith(this Transform transform, Transform targetTransform, float percent, bool includeScale = true)
var rotation = transform.basis.Orthonormalized().ToQuat();
cart / NodeExtensions.cs
Created Feb 1, 2018
A collection of C# Node extensions for Godot
View NodeExtensions.cs
using Godot;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace HighHat.Scene.Nodes
public static class NodeExtensions
private static Regex _nameRegex = new Regex("@*(?<Name>[\\w|\\d]+)@*.*");