-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgame_win.gd
More file actions
35 lines (28 loc) · 785 Bytes
/
game_win.gd
File metadata and controls
35 lines (28 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
extends Node2D
var opacity = 0
var asd = true
@onready var captured_image = $CapturedImage
# Called when the node enters the scene tree for the first time.
func _ready():
# Retrieve the captured image.
var img = get_viewport().get_texture().get_image()
# Create a texture for it.
var tex = ImageTexture.create_from_image(img)
# Set the texture to the captured image node.
captured_image.set_texture(tex)
#while(true):
func _physics_process(delta):
if Input.is_action_just_pressed("LMB"):
get_tree().change_scene_to_file("res://globals.tscn")
#pass
# opacity += 0.1
# modulate.a = opacity
# await get_tree().create_timer(0.3).timeout
func _on_timer_timeout():
if asd:
opacity += 0.01
modulate.a = opacity
if opacity > 1:
opacity = 1
asd = false
#