mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-21 15:44:23 +00:00
Add postprocessing shader toggle
This commit is contained in:
parent
ffe54a0f1e
commit
db86924613
7 changed files with 30 additions and 10 deletions
12
main.tscn
12
main.tscn
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://b38wkla8e7rmo"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_jyg3q"]
|
||||
[ext_resource type="Material" uid="uid://dpumcyplql08q" path="res://postprocess.material" id="2_3o1ux"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkm7id1wdwywg" path="res://scenes/menu/safe_margin_container.tscn" id="2_ah6n8"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyodbq3yrbi87" path="res://postprocessing/postprocessing_rect.tscn" id="2_shp84"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_jyg3q")
|
||||
|
@ -10,15 +10,7 @@ starting_stage = 3
|
|||
|
||||
[node name="PostprocessingCanvas" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="PostprocessingCanvas"]
|
||||
texture_filter = 1
|
||||
material = ExtResource("2_3o1ux")
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
[node name="PostprocessingRect" parent="PostprocessingCanvas" instance=ExtResource("2_shp84")]
|
||||
|
||||
[node name="InterfaceCanvas" type="CanvasLayer" parent="."]
|
||||
|
||||
|
|
Binary file not shown.
BIN
postprocessing/postprocess.material
Normal file
BIN
postprocessing/postprocess.material
Normal file
Binary file not shown.
8
postprocessing/postprocessing_rect.gd
Normal file
8
postprocessing/postprocessing_rect.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends ColorRect
|
||||
class_name PostprocessingRect
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventKey:
|
||||
if event.is_action_pressed(&"postprocessing_toggle"):
|
||||
visible = !visible
|
15
postprocessing/postprocessing_rect.tscn
Normal file
15
postprocessing/postprocessing_rect.tscn
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dyodbq3yrbi87"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://dpumcyplql08q" path="res://postprocessing/postprocess.material" id="1_sswlf"]
|
||||
[ext_resource type="Script" path="res://postprocessing/postprocessing_rect.gd" id="2_om0qv"]
|
||||
|
||||
[node name="PostprocessingRect" type="ColorRect"]
|
||||
texture_filter = 1
|
||||
material = ExtResource("1_sswlf")
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
script = ExtResource("2_om0qv")
|
|
@ -33,6 +33,11 @@ main_menu={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194317,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
postprocessing_toggle={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194311,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
|
Loading…
Reference in a new issue