This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "base:runtime" | |
import "core:os" | |
import "core:mem" | |
import "core:log" | |
import sdl "vendor:sdl3" | |
g_ctx: runtime.Context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Spatial | |
# Helper classes | |
tool | |
class_name Terrain | |
class Hex: | |
#CONST FOR HEX | |
const hex_directions = [ | |
Vector3( 0, -1, 1), Vector3( 1, -1, 0), Vector3( 1, 0, -1), | |
Vector3( 0, 1, -1), Vector3(-1, 1, 0), Vector3(-1, 0, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Вопрос: | |
"Всё пропало! При <каком-то действии> Invalid call. Nonexistent function 'bla-bla_function' in base 'Control (MyControl.gd)'., вот в этой части кода!!!" | |
Ответ: | |
Годо сука умный. Он таки говорит, что у тебя нет функции "bla-bla_function" в контроле, к которому приделан скрипт "MyControl.gd". А это значит, надо понимать, у кого дёргаешь функцию. | |
Вопрос: | |
"а при <каком-то другом действии> Invalid call. Nonexistent function 'get_some_shit' in base 'String'.... | |
Ответ: | |
В общем-то, те же яйца, но слегка с другого ракурса. Проверять свой код надо, твою дивизию. Какого фига ты у стринга, который простая строка (это когда буковки вместе), есть функция "get_some_shit"? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loaded = {} | |
func get_tex_from_drive(path, flags=Texture.FLAG_FILTER, store=true): | |
if store and path in loaded: | |
return loaded[path] | |
var file = File.new() | |
if file.open(path, File.READ) == OK: | |
# Have file | |
var data : PoolByteArray = file.get_buffer(file.get_len()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform vec4 col : hint_color; | |
uniform float eff_str = 0.8; | |
float rand(float x){ | |
return fract(cos(x) * 2345.6789); | |
} | |
float triangle(float x){ | |
return abs(1.0 - mod(abs(x), 2.0)) * 2.0 - 1.0; | |
} | |
void fragment() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform vec4 edge_color : hint_color = vec4(0.4, 0.4,0.4,1); | |
uniform vec2 resolution = vec2(800.0,600.0); | |
void fragment(){ | |
float width = resolution.x; | |
float height = resolution.y; | |
float w = 1.0 / width; | |
float h = 1.0 / height; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform sampler2D mask; | |
void fragment(){ | |
vec4 col = texture(mask, UV); | |
if(col.a == 0.0){ | |
COLOR = col; | |
} | |
else if (col.a > .99){ |