Skip to content

Instantly share code, notes, and snippets.

View 2439905184's full-sized avatar
:atom:
Working from home

小沙盒工作室-室长 2439905184

:atom:
Working from home
View GitHub Profile
@2439905184
2439905184 / 字符串切割.aardio
Last active May 27, 2022 08:14
aardio语言 字符串分割代码
var a = string.split("apple,banana,stone","<,>")
console.log(table.unpack(a))
@2439905184
2439905184 / exe bits
Created May 26, 2022 12:02
判断exe位数
如果使用16进制编辑器打开你的exe文件的话,可以看到如图的效果,里面的hex code: 504500004C就表示是32位的,而hex code: 504500006486就表示是64_86,也就是64位的。
@2439905184
2439905184 / 空格词法分析器
Created May 19, 2022 10:06
空格词法分析器
var a = "@bg adobe.png 1.5"
console.log(a.split(/\s+/))
@2439905184
2439905184 / 从godot搬过来的标尺自绘制代码
Created May 15, 2022 13:17
标尺自绘制实现代码(godot)
Code taken and modified from Godot's source code
func _draw() -> void:
var transform := Transform2D()
var ruler_transform := Transform2D()
var major_subdivide := Transform2D()
var minor_subdivide := Transform2D()
var zoom: float = 1 / Global.camera.zoom.x
transform.x = Vector2(zoom, zoom)
# This tracks the "true" top left corner of the drawing:
@2439905184
2439905184 / godot透明贴图着色器
Created May 13, 2022 03:54
godot透明贴图着色器
shader_type canvas_item;
render_mode unshaded;
uniform float size = 10.0;
uniform float alpha = 1.0;
uniform vec4 color1 : hint_color = vec4(0.7, 0.7, 0.7, 1.0);
uniform vec4 color2 : hint_color = vec4(1.0);
uniform vec2 offset = vec2(0.0);
uniform vec2 scale = vec2(0.0);
uniform vec2 rect_size = vec2(0.0);
@2439905184
2439905184 / EasyFile
Created April 21, 2022 13:20
android EasyFile (load)
package com.littlesandbox.libeasy;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class EasyFile
{
@2439905184
2439905184 / mmd转gltf材质.py
Last active April 16, 2022 09:17
此版本完成了材质转bsdf,但是贴图不对,需要手动修改
```python
#from easybpy import *
import bpy
#this is use for change only actived mat
#param p_mat:#bpy.context.object.active_material
def change_active_material(p_mat):
mat = p_mat
nodes = mat.node_tree.nodes
@2439905184
2439905184 / 编译Godot引擎,最后一步的链接问题
Created March 30, 2022 09:11
编译Godot引擎,最后一步的链接问题
此配置适用于我:
Parallels VM
gcc 上的 Ubuntu 21.10 ARM64 (Ubuntu 11.2.0-7ubuntu2) 11.2.0 或 Ubuntu clang 版本 13.0.0-2
使用的命令:(对于 GCC)
或(对于 Clang)
3.x 使用上述命令,并且主分支也有效(但 p=linuxbsd 而不是 p=x11)。scons -j6 arch=arm64 p=x11 tools=yes module_gdnative_enabled=noscons -j6 arch=arm64 p=x11 tools=yes use_llvm=yes
Godot 3.3 和 3.4 在 Mageia 8 和 Fedora 33+ 上都为我构建得很好。我想这里的问题可能是 Debian 10 的旧工具链中的一个错误/不完整的 aarch64 支持。
我建议尝试使用更新的操作系统,或者至少是更新的GCC和binutils版本。
@2439905184
2439905184 / 交叉淡化的例子
Created March 29, 2022 09:31
交叉淡化的例子
http://visual-arts.jp/recruitment/
@2439905184
2439905184 / image cross fade.txt
Last active March 27, 2022 07:29
交叉淡化技术
https://www.zhangxinxu.com/study/201209/css3-background-image-cross-fade.html
suika2 ->stage.h
//启用角色淡入淡出模式时进行舞台绘制
void draw_stage_ch_fade(int fade_method)
//绘制默认背景淡入淡出 LAYER_FO和LAYER_FI是特殊的实体图像
static void draw_stage_fi_fo_fade_normal()
{
render_layer_image(LAYER_FO);
render_layer_image(LAYER_FI);