Skip to content

Instantly share code, notes, and snippets.

View rzuf79's full-sized avatar

rzuf rzuf79

View GitHub Profile
@rzuf79
rzuf79 / hnum.lua
Last active April 29, 2024 12:50
Hnum - a barbaric large number module for games. Stores obscenely large numbers for you and spits out nicely formatted strings for displaying them in a human-readable formak like "1.5k". Supports arithmetic operations and whatnot.
--[[
Hnum - a barbaric large number module for games.
Usage:
local a_hundred = HNum:new(100)
print(a_hundred:get_formatted()) -- 100
local a_thousand = HNum:new(1000)
@rzuf79
rzuf79 / hnum.lua
Last active April 27, 2024 10:52
Hnum - a barbaric large number module for games.
--[[
Hnum - a barbaric large number module for games.
Usage:
local a_hundred = HNum:new(100)
print(a_hundred:get_formatted()) -- 100
local a_thousand = HNum:new(1000)
@rzuf79
rzuf79 / canvas_scaler.gd
Created November 28, 2023 10:50
Viewport/Canvas scaler for Godot 4
extends Node
"""
Viewport scaling for Godot 4
It's supposed to work similar to Unity's CanvasScaler set to
"Match Width or Height"
It's best to stick this to an autoloaded node.
"""
@export var enable := true
#ifndef _JEVKO_H
#define _JEVKO_H
#include <stdio.h>
#include <string.h>
typedef struct {
char* name;
char* value;
} Jevko;
@rzuf79
rzuf79 / viewport_scaler.gd
Created April 4, 2022 08:14
Viewport scaling for Godot
extends Node2D
"""
Viewport scaling for Godot
It's supposed to work similar to Unity's CanvasScaler set to
"Match Width or Height"
It's best to add to stick this to an autoloaded node.
"""