mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Size newly added resources in the world editor properly.
This commit is contained in:
parent
69054c8fa5
commit
9145867ac4
@ -49,6 +49,8 @@ func add_item(item_name : String = "") -> void:
|
||||
e = Zone.new()
|
||||
elif cn == "SubZone":
|
||||
e = SubZone.new()
|
||||
elif cn == "SubZoneProp":
|
||||
e = SubZoneProp.new()
|
||||
|
||||
elif ti.has_meta("file"):
|
||||
var cls = load(ti.get_meta("file"))
|
||||
@ -61,6 +63,14 @@ func add_item(item_name : String = "") -> void:
|
||||
|
||||
e.resource_name = item_name
|
||||
|
||||
var r : Rect2 = edited_resource.get_rect()
|
||||
var rs : Vector2 = r.size
|
||||
r.size.x /= 10.0
|
||||
r.size.y /= 10.0
|
||||
r.position = rs / Vector2(2, 2)
|
||||
r.position -= r.size / Vector2(2, 2)
|
||||
e.set_rect(r)
|
||||
|
||||
#edited_resource.add_content(e)
|
||||
#remove_content_entry
|
||||
|
||||
|
@ -9,9 +9,6 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
hide_root = true
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="NameDialog" type="ConfirmationDialog" parent="."]
|
||||
margin_right = 329.0
|
||||
|
Loading…
Reference in New Issue
Block a user