Skip to content

Instantly share code, notes, and snippets.

@GreenCrowDev
GreenCrowDev / godot_gdextension_beginners_001.md
Last active May 3, 2024 14:15
Godot 4 GDExtension plugin development for beginners [Part 1]

Typing SVG

I'm on X (formerly Twitter) Follow and YouTube Channel Subscribers , anyone is welcome: feel free to get in contact if you need any help!
If you appreciate my work, consider buying me a coffee and help me go full-time!

@winston-yallow
winston-yallow / test.gd
Last active January 25, 2024 06:32
Godot 4.x Compute Example
extends Node
# Based on this tweet by Clay John:
# https://twitter.com/john_clayjohn/status/1306447928932753408
func _ready() -> void:
# Create a local rendering device.
var rd := RenderingServer.create_local_rendering_device()
'''
FBO example
===========
This is an example of how to use FBO (Frame Buffer Object) to speedup graphics.
An Fbo is like a texture that you can draw on it.
By default, all the children are added in the canvas of the parent.
When you are displaying thousand of widget, you'll do thousands of graphics
instructions each frame.
@xjohjrdy
xjohjrdy / xiaoxiao_tts.py
Last active September 10, 2024 19:50
返回的音频没有文件头,所以我随便加的一个文件头,但显示的音频时长有问题。如果播放器不能正常播放,可以使用Chrome播放。
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ws4py.client.threadedclient import WebSocketClient
import binascii
class WSClient(WebSocketClient):
def __init__(self, url, text, filename):
@hideya
hideya / flex-wrap-anim.js
Last active April 25, 2023 05:49
CSS Flex Wrap Animation (code assumes no change in items except xy coords): https://codepen.io/hideya/pen/Jamabx
window.addEventListener('load', function(event) {
var targetClassName = 'flex-wrap-anim';
var defaultDuration = '0.3s';
var dummyList = [];
function addDummy(item, duration) {
var top = item.offsetTop;
var left = item.offsetLeft;
setTimeout(function() {
item.style.position = 'absolute';
@hongyuanjia
hongyuanjia / aria2.bat
Created February 27, 2018 02:31 — forked from Rhilip/aria2.bat
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
effect_drop_shadow = '''
#define M_PI 3.1415926535897932384626433832795
vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) {{
vec2 coords2;
float x, y;
float radius, sampling, surface;
vec4 tint, shadow;
coords2 = coords + vec2({offset_x:f}, {offset_y:f}) ;
from kivy.lang import Builder
from kivy.base import runTouchApp
KV = '''
#:import DropShadow kivy.uix.effectwidget.DropShadowEffect
<T@Label>:
size_hint_x: None
width: self.texture_size[0]
<S@Slider>: