fuck around with native script

This commit is contained in:
zoe 2022-05-02 00:20:37 +02:00
parent f0ea635b71
commit a95e7cd77b
5 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,8 @@
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://native/nativelibrary.gdnlib" type="GDNativeLibrary" id=1]
[resource]
resource_name = "StateServer"
class_name = "StateServer"
library = ExtResource( 1 )

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://world/state_server.gdns" type="Script" id=1]
[ext_resource path="res://native/StateServer.gdns" type="Script" id=1]
[node name="StateServer" type="Node"]
script = ExtResource( 1 )

View file

@ -0,0 +1,14 @@
[entry]
X11.64="res://native/libroutes_native.so"
[dependencies]
X11.64=[ ]
[general]
singleton=false
load_once=true
symbol_prefix="godot_"
reloadable=true

View file

@ -1,7 +1,7 @@
extends Node
var server = preload("res://native/StateServer.tscn").instance()
# Called when the node enters the scene tree for the first time.
func _ready():
add_child(server)
print(server.a)

View file

@ -15,7 +15,7 @@ mode = 1
tile_set = ExtResource( 1 )
cell_size = Vector2( 32, 16 )
format = 1
tile_data = PoolIntArray( -65538, 0, 131075, -65537, 0, 131073, -2, 0, 131073, -1, 0, 131075 )
tile_data = PoolIntArray( -65538, 0, 131075, -65537, 0, 131073, -131072, 0, 0, -2, 0, 131073, -1, 0, 131075, -65536, 0, 0, 0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0 )
[node name="Worldcam" type="Camera2D" parent="."]
current = true