Skip to content

Instantly share code, notes, and snippets.

Sample test for getting the font working as cimgui conflict with font type from imgui.

rlgl_font.c main point.

raylib 5.5 cimgui

@Lightnet
Lightnet / raylib_picking.c
Last active September 26, 2025 22:51
Sample raylib 5.5 flecs 4.1 raygui picking single cube test.
// raylib 5.5
// flecs v4.1
// https://github.com/SanderMertens/flecs/blob/master/examples/c/systems/custom_pipeline/src/main.c
// right mouse toggle camera capture
// W,A,S,D = move camera when capture mouse
// escape to close app
// left mouse button to select cube
#include <stdio.h>
#include <flecs.h>
@Lightnet
Lightnet / main_transform_select_list.c
Created September 26, 2025 07:23
Sample raylib 5.5 flecs 4.1 raygui select node transform edit test.
// raylib 5.5
// flecs v4.1.1
// strange rotation for gui
// y -85 to 85 is cap else it will have strange rotate.
// note that child does not update the changes.
#include <stdio.h>
#include "raylib.h"
#include "raymath.h"
#include "flecs.h"
#define RAYGUI_IMPLEMENTATION
@Lightnet
Lightnet / raylib3d_flecs_transform_hierarchy_gui09.c
Last active September 26, 2025 06:18
sample test raylib 5.5 flecs 4.1 raygui transform test.
// flecs v4.1.1
// strange rotation for gui
// y -85 to 85 is cap else it will have strange rotate.
#include <stdio.h>
#include "raylib.h"
#include "raymath.h"
#include "flecs.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
@Lightnet
Lightnet / rl_flecs_camera3d.c
Created September 26, 2025 00:43
sample raylib 5.5 flecs 4.1 raygui move position silder test
// raylib 5.5
// flecs v4.1
// https://github.com/SanderMertens/flecs/blob/master/examples/c/systems/custom_pipeline/src/main.c
//
#include <stdio.h>
#include <flecs.h>
#include "raylib.h"
#include <math.h>
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
@Lightnet
Lightnet / rl_flecs_camera3d_cube_wireframe.c
Created September 25, 2025 21:03
raylib 5.5 flecs 4.1 test params
// raylib
// https://github.com/SanderMertens/flecs/blob/master/examples/c/systems/custom_pipeline/src/main.c
#include <stdio.h>
#include <flecs.h>
#include "raylib.h"
//#define RAYGUI_IMPLEMENTATION
//#include "raygui.h"
// component
@Lightnet
Lightnet / circle_menu_shader.gdshader
Created July 11, 2025 16:16
Using the shader for circle menu godot 4
shader_type canvas_item;
uniform float segment_width = 0.2; // Angular width of each segment (radians)
uniform float inner_radius = 0.1; // Inner radius of segments (UV space, 0.0–0.5)
uniform float outer_radius = 0.5; // Outer radius of segments (UV space, 0.0–0.5)
uniform float rotation_offset = 0.0; // Rotation offset in radians
uniform int segments = 8; // Number of segments (menu items)
uniform int selected_index = 0; // Selected segment (0–7)
uniform vec4 line_color = vec4(1.0, 1.0, 1.0, 1.0); // Non-selected segment color
uniform vec4 selected_color = vec4(1.0, 0.5, 0.5, 1.0); // Selected segment color
@Lightnet
Lightnet / circle_ring_rope.gd
Created June 24, 2025 17:32
sample test rope circle uv texture.
@tool
extends MeshInstance3D
@export var rope_length: float = 5.0 # Total length of the rope
@export var segments: int = 20 # Number of segments
@export var radius: float = 0.1 # Thickness of the rope
@export var sides: int = 8 # Number of sides for the rope's cross-section
func _ready() -> void:
generate_rope()
@Lightnet
Lightnet / ring_texture3d03_working_uv.gd
Created June 23, 2025 05:35
circle uv test godot 4
@tool
extends MeshInstance3D
# this is for ImmediateMesh
# works uv align but scale does not work.
# Rope properties
@export var rope_width: float = 0.1 # Radius of the rope
@export var resoulution: int = 8 # Number of vertices around the rope's circumference
@export var uv_scale: Vector2 = Vector2(1.0, 1.0) # UV scaling factor
@export var texture_height_to_width: float = 1.0 # Texture aspect ratio (height/width)