85ca2419e74c07938d6da0d3a823ff104a4593fc — Drew DeVault 5 months ago 02760ff
Fix positioning of new windows

Setting scale overrides a great deal of transform-related properties on
the scene in its parent
2 files changed, 5 insertions(+), 7 deletions(-)

M threeston/prefabs/surface/Surface.gd
M threeston/scenes/Main.tscn
M threeston/prefabs/surface/Surface.gd => threeston/prefabs/surface/Surface.gd +1 -3
@@ 15,7 15,6 @@ func _on_SurfaceNode_map(surface):
 	size *= state.get_scale()
 	if $Viewport2D.get_size() != size:
 		$Viewport2D.set_size(size)
-		self.scale = Vector3(1, 1, 1) / state.get_scale()
 	emit_signal("map", self)
 	set_process(true)
 


@@ 34,5 33,4 @@ func _process(delta):
 	size *= state.get_scale()
 	if $Viewport2D.get_size() != size:
 		# TODO: This doesn't seem to work when resizing the viewport at runtime :<
-		$Viewport2D.set_size(size)
-		self.scale = Vector3(1, 1, 1) / state.get_scale()>
\ No newline at end of file
+		$Viewport2D.set_size(size)<
\ No newline at end of file

M threeston/scenes/Main.tscn => threeston/scenes/Main.tscn +4 -4
@@ 1,9 1,9 @@
 [gd_scene load_steps=8 format=2]
 
 [ext_resource path="res://scenes/Game_Manager.gd" type="Script" id=1]
-[ext_resource path="res://prefabs/environment/Environment.tscn" type="PackedScene" id=2]
+[ext_resource path="res://prefabs/player_demo/Player.tscn" type="PackedScene" id=2]
 [ext_resource path="res://sprites/crosshair.png" type="Texture" id=3]
-[ext_resource path="res://prefabs/player_demo/Player.tscn" type="PackedScene" id=4]
+[ext_resource path="res://prefabs/environment/Environment.tscn" type="PackedScene" id=4]
 [ext_resource path="res://prefabs/player_demo/bullet_mat.tres" type="Material" id=5]
 
 [sub_resource type="BoxShape" id=1]


@@ 14,7 14,7 @@ extents = Vector3( 300, 1, 300 )
 [node name="Game_Manager" type="Node"]
 script = ExtResource( 1 )
 
-[node name="Environment" parent="." instance=ExtResource( 2 )]
+[node name="Environment" parent="." instance=ExtResource( 4 )]
 
 [node name="Dead_Zone" type="Area" parent="."]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -30, 0 )


@@ 38,7 38,7 @@ __meta__ = {
 scale = Vector2( 0.15, 0.15 )
 texture = ExtResource( 3 )
 
-[node name="Player" parent="." instance=ExtResource( 4 )]
+[node name="Player" parent="." instance=ExtResource( 2 )]
 
 [node name="MeshInstance" type="MeshInstance" parent="."]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.88192, 1, -16.4228 )