8 changed files with 205 additions and 18 deletions
@ -1,2 +1,99 @@
@@ -1,2 +1,99 @@
|
||||
# GenerateTools使用手册 |
||||
|
||||
> GenerateTools旨在生成任何应用程序中的组件,变量,对象,以及用到的一些流程等等。同时依赖于Save Tools强大的本地文件加载能力,Generate Tools可以通过配置各种文件实现界面的简单生成,菜单的生成,可编辑表格,可编辑项。 |
||||
> |
||||
> 再此之上,有些通用模板也会放在此工具下,方便扩展与生成。 |
||||
|
||||
```mermaid |
||||
mindmap |
||||
root((Generate-Tools)) |
||||
Code |
||||
SVG |
||||
Dialog |
||||
Basic |
||||
Confirm |
||||
Edit |
||||
File |
||||
UI |
||||
EditParam |
||||
Table |
||||
Menu |
||||
Tree |
||||
Inteface |
||||
Variant |
||||
Tree |
||||
Range |
||||
Select |
||||
Path |
||||
ReadOnly |
||||
``` |
||||
|
||||
## 📈生成一个可编辑表格 |
||||
|
||||
定义数据类,以学生信息为例 |
||||
|
||||
```csharp |
||||
public struct DataStudent |
||||
{ |
||||
public int ID; |
||||
public string Name { get; set; } |
||||
public int Age; |
||||
public EGPathSelect Path { set; get; } |
||||
public DataStudent(string name, int age) |
||||
{ |
||||
Name = name; |
||||
Age = age; |
||||
ID = 0; |
||||
Path = new EGPathSelect(); |
||||
} |
||||
} |
||||
``` |
||||
|
||||
实例化一组学生信息对象列表,然后通过EGodotTable来对该列表进行初始化 |
||||
|
||||
```csharp |
||||
public void TestTable() |
||||
{ |
||||
container = this.GetNode<TabContainer>("TabContainer"); |
||||
List<DataStudent> dataStudents = new List<DataStudent>(); |
||||
for (int stu = 0; stu < 10; stu++) |
||||
{ |
||||
dataStudents.Add(new DataStudent("stu" + stu, 18)); |
||||
} |
||||
for (int stu = 0; stu < 11; stu++) |
||||
{ |
||||
dataStudents.Add(new DataStudent("A" + stu, 20 + stu)); |
||||
} |
||||
EGodotTable table = container.CreateNode<EGodotTable>("Default"); |
||||
table.InitData<DataStudent>(dataStudents); |
||||
} |
||||
``` |
||||
|
||||
运行结果如下 |
||||
|
||||
 |
||||
|
||||
 |
||||
|
||||
## 🌲生成一个树 |
||||
|
||||
定义一个Json,使用EGodotTree来对该Json进行初始化 |
||||
|
||||
```csharp |
||||
public void TestTree() |
||||
{ |
||||
string json = @"{ |
||||
'CPU': 'Intel', |
||||
'PSU': '500W', |
||||
'My' : { |
||||
'AA':'BB', |
||||
'Date': 111 |
||||
} |
||||
}"; |
||||
container = this.GetNode<TabContainer>("TabContainer"); |
||||
EGodotTree eGodotTree = container.CreateNode<EGodotTree>("TestTree"); |
||||
eGodotTree.InitByJson(json); |
||||
} |
||||
``` |
||||
|
||||
 |
||||
|
After Width: | Height: | Size: 53 KiB |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="CompressedTexture2D" |
||||
uid="uid://b2tuqm72haaab" |
||||
path="res://.godot/imported/GenerateTools_001.JPG-fef7115ccd57135de62d4bd2954db1db.ctex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Manual/Img/GenerateTools_001.JPG" |
||||
dest_files=["res://.godot/imported/GenerateTools_001.JPG-fef7115ccd57135de62d4bd2954db1db.ctex"] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/high_quality=false |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_compression=1 |
||||
compress/normal_map=0 |
||||
compress/channel_pack=0 |
||||
mipmaps/generate=false |
||||
mipmaps/limit=-1 |
||||
roughness/mode=0 |
||||
roughness/src_normal="" |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/normal_map_invert_y=false |
||||
process/hdr_as_srgb=false |
||||
process/hdr_clamp_exposure=false |
||||
process/size_limit=0 |
||||
detect_3d/compress_to=1 |
After Width: | Height: | Size: 62 KiB |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="CompressedTexture2D" |
||||
uid="uid://c4fu1phlhotka" |
||||
path="res://.godot/imported/GenerateTools_002.JPG-7bb9bdf7b55c6f9bc9f2bca6dee8a982.ctex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Manual/Img/GenerateTools_002.JPG" |
||||
dest_files=["res://.godot/imported/GenerateTools_002.JPG-7bb9bdf7b55c6f9bc9f2bca6dee8a982.ctex"] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/high_quality=false |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_compression=1 |
||||
compress/normal_map=0 |
||||
compress/channel_pack=0 |
||||
mipmaps/generate=false |
||||
mipmaps/limit=-1 |
||||
roughness/mode=0 |
||||
roughness/src_normal="" |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/normal_map_invert_y=false |
||||
process/hdr_as_srgb=false |
||||
process/hdr_clamp_exposure=false |
||||
process/size_limit=0 |
||||
detect_3d/compress_to=1 |
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="CompressedTexture2D" |
||||
uid="uid://crtdss0o45blw" |
||||
path="res://.godot/imported/GenerateTools_003.JPG-f588ba68b13367797de19c266c495b79.ctex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Manual/Img/GenerateTools_003.JPG" |
||||
dest_files=["res://.godot/imported/GenerateTools_003.JPG-f588ba68b13367797de19c266c495b79.ctex"] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/high_quality=false |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_compression=1 |
||||
compress/normal_map=0 |
||||
compress/channel_pack=0 |
||||
mipmaps/generate=false |
||||
mipmaps/limit=-1 |
||||
roughness/mode=0 |
||||
roughness/src_normal="" |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/normal_map_invert_y=false |
||||
process/hdr_as_srgb=false |
||||
process/hdr_clamp_exposure=false |
||||
process/size_limit=0 |
||||
detect_3d/compress_to=1 |
Loading…
Reference in new issue