...
 
Commits (4)
......@@ -11,5 +11,10 @@
*.out
# !parameters.pdf
# Sphinx docs
**/sphinx/build
__pycache__
# Godot
*.import/
*.import
# Contributing to Avatar ENSignes
## Commits
Remember [Drew de Vault's advice](https://docs.godotengine.org/en/latest/classes/index.html):
Try to write the first phrase of each commit message as "When applied, this
commit will..."
## Coding Style
The program is written in Godot's scripting language GDScript. We follow here
the
[style guide](https://docs.godotengine.org/en/latest/getting_started/\scripting/gdscript/gdscript_styleguide.html)
described in Godot Documentation.
The API follows the same style as [Godot API](https://docs.godotengine.org/en/latest/classes/index.html)
......@@ -34,13 +34,14 @@
\attribute{cursor: Cursor}
\attribute{marker: Int}
\attribute{active\_marker: Bool}
\attribute{font\_size: Int}
\operation{update(beg: Int, end:Int): void}
\operation{insert(sign: SignSymb): void}
\operation{modify(sign: SignSymb): void}
\operation{remove\_left()}
\operation{remove\_right()}
\operation{pop\_slice():void)}
\operation{pop\_slice():void}
\operation{get\_slice(): SignSymb Array}
\operation{align(x:Int, y:Int): Int}
\operation{place(index: Int):(Int $\times$ Int)}
......@@ -77,10 +78,10 @@
\end{class}
\begin{class}{SheetElement}{15,0}
\attribute{fontSize: Int}
\attribute{font\_size: Int}
\attribute{design: Godot Data}
\attribute{pos: Int$\times$Int}
\attribute{textPos: Int}
\attribute{text\_pos: Int}
\operation{getters, setters}
\end{class}
......
[gd_scene format=2]
[node name="SignSymb" type="Control"]
margin_right = 35.0
margin_bottom = 14.0
__meta__ = {
"_edit_group_": true
}
[node name="Label" type="Label" parent="."]
margin_right = 35.0
margin_bottom = 14.0
mouse_filter = 1
mouse_default_cursor_shape = 1
text = "A....Z"
extends Container
# WorkSpace
# handles speech display
# Classes
export (PackedScene) var SignSymb
# Properties
export var sep = Vector2(5, 5)
var text = []
# puts the SignSymbs in the grid
func dispose_childs():
if text == []:
return
var symb_size = text[0].get_size()
var space = symb_size + sep
var pos = Vector2(0, 0)
print(symb_size, space, pos)
for symb in text:
if pos.x + symb_size.x > rect_size.x: # Line Wrapping
pos.y += space.y
pos.x = 0
print(pos.x)
fit_child_in_rect(symb, Rect2(pos, rect_size))
pos.x += space.x
func test():
var symb
for i in range(20):
symb = SignSymb.instance()
add_child(symb)
text.append(symb)
dispose_childs()
# Called when the node enters the scene tree for the first time.
func _ready():
test()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=3 format=2]
[ext_resource path="res://WorkSpace.gd" type="Script" id=1]
[ext_resource path="res://SignSymb.tscn" type="PackedScene" id=2]
[node name="WorkSpace" type="Container"]
margin_right = 620.0
margin_bottom = 480.0
script = ExtResource( 1 )
SignSymb = ExtResource( 2 )
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="Editor"
config/icon="res://icon.png"
[rendering]
quality/driver/driver_name="GLES2"
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_environment="res://default_env.tres"