Stuff
This commit is contained in:
16
MainGame.gd
16
MainGame.gd
@@ -18,7 +18,7 @@ func _ready():
|
||||
func _on_transitioned(scene):
|
||||
print ("this transitioned")
|
||||
reset_camera(scene)
|
||||
$label._on_transitioned()
|
||||
$label._on_transitioned(scene)
|
||||
#scene.connect("transitioned", $label, "_on_transitioned")
|
||||
scene.connect("transitioned", Callable(self, "_on_transitioned"))
|
||||
|
||||
@@ -27,12 +27,18 @@ func reset_camera(scene):
|
||||
#$Node2D.scale = Vector2(scene.background_scale, scene.background_scale)
|
||||
#var far_point = self.to_global(Vector2(scene.find_child("bg").texture.get_width(), scene.find_child("bg").texture.get_height() ) )
|
||||
var x:Sprite2D = scene.find_child("bg");
|
||||
var far_point = self.to_global(Vector2(x.texture.get_width(), x.texture.get_height() ) * x.get_global_transform())
|
||||
var height = x.texture.get_height()
|
||||
var far_point = self.to_global(Vector2(x.texture.get_width(), x.texture.get_height() ) * x.get_global_transform())
|
||||
print(far_point)
|
||||
var bg = $Node2D/background
|
||||
$Node2D/background/Graham/Camera2D.limit_right = far_point.x
|
||||
$Node2D/background/Graham/Camera2D.limit_bottom =far_point.y
|
||||
$Node2D/background/Graham/Camera2D.reset_smoothing()
|
||||
$Camera2D.make_current()
|
||||
$Camera2D.limit_right = far_point.x
|
||||
$Camera2D.limit_bottom=far_point.y
|
||||
$Node2D/background/Graham/RemoteTransform2D.remote_path=$Camera2D.get_path()
|
||||
$Camera2D.reset_smoothing()
|
||||
#$Node2D/background/Graham/Camera2D.limit_right = far_point.x
|
||||
#$Node2D/background/Graham/Camera2D.limit_bottom =far_point.y
|
||||
#$Node2D/background/Graham/Camera2D.reset_smoothing()
|
||||
|
||||
#$Node2D/background/Graham/Camera2D.reset_smoothing()
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
||||
Reference in New Issue
Block a user