camera channels zoom out effect looks very feasible
This commit is contained in:
parent
bf835edaeb
commit
caa2cd4c11
10 changed files with 163 additions and 55 deletions
24
base modules/channel_controller.gd
Normal file
24
base modules/channel_controller.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
extends Control
|
||||
class_name Channel
|
||||
|
||||
|
||||
@export var channel_name : String
|
||||
@export_group("Node References")
|
||||
@export var offline_channel_cover : TextureRect
|
||||
@export var game_viewport : SubViewport
|
||||
|
||||
var channel_online : bool
|
||||
|
||||
|
||||
|
||||
func start_channel():
|
||||
pass
|
||||
|
||||
func end_channel():
|
||||
pass
|
||||
|
||||
func win_channel():
|
||||
pass
|
||||
|
||||
func lose_channel():
|
||||
pass
|
||||
1
base modules/channel_controller.gd.uid
Normal file
1
base modules/channel_controller.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://h43mmpjmmir4
|
||||
63
base modules/test_channel.tscn
Normal file
63
base modules/test_channel.tscn
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://63rik2noj8id"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_iix04"]
|
||||
[ext_resource type="Script" uid="uid://h43mmpjmmir4" path="res://base modules/channel_controller.gd" id="1_r07ln"]
|
||||
[ext_resource type="Texture2D" uid="uid://cyo0wl4dt3td1" path="res://sprites/offline_channel.png" id="2_01b3p"]
|
||||
[ext_resource type="Script" uid="uid://dlqr0ghj0sh6a" path="res://base modules/move_test.gd" id="2_jbg2j"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_iix04"]
|
||||
viewport_path = NodePath("GameViewport")
|
||||
|
||||
[node name="Control" type="Control" node_paths=PackedStringArray("offline_channel_cover", "game_viewport")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_r07ln")
|
||||
channel_name = "Test"
|
||||
offline_channel_cover = NodePath("OfflineChannelCover")
|
||||
game_viewport = NodePath("GameViewport")
|
||||
|
||||
[node name="GameDisplay" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("ViewportTexture_iix04")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="OfflineChannelCover" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_01b3p")
|
||||
|
||||
[node name="GameViewport" type="SubViewport" parent="."]
|
||||
handle_input_locally = false
|
||||
size = Vector2i(640, 360)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="ColorRect" type="TextureRect" parent="GameViewport"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_iix04")
|
||||
|
||||
[node name="Node2D" type="Node2D" parent="GameViewport"]
|
||||
script = ExtResource("2_jbg2j")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="GameViewport/Node2D"]
|
||||
texture = ExtResource("1_iix04")
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://ct8axfbvd2wn4"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ct8axfbvd2wn4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://63rik2noj8id" path="res://test_channel.tscn" id="1_mlf6e"]
|
||||
[ext_resource type="PackedScene" uid="uid://63rik2noj8id" path="res://base modules/test_channel.tscn" id="1_mlf6e"]
|
||||
[ext_resource type="Texture2D" uid="uid://cyo0wl4dt3td1" path="res://sprites/offline_channel.png" id="2_po0ka"]
|
||||
|
||||
[node name="GameScene" type="Control"]
|
||||
layout_mode = 3
|
||||
|
|
@ -10,6 +11,15 @@ anchor_bottom = 1.0
|
|||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
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="GridContainer" type="GridContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
|
|
@ -21,43 +31,63 @@ columns = 3
|
|||
|
||||
[node name="Control" parent="GridContainer" instance=ExtResource("1_mlf6e")]
|
||||
layout_mode = 2
|
||||
channel_name = ""
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect2" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect2" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect3" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect3" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect4" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect4" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect5" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect5" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect6" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect6" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect7" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect7" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ColorRect8" type="ColorRect" parent="GridContainer"]
|
||||
[node name="ColorRect8" type="TextureRect" parent="GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_po0ka")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2(320, 180)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ config/icon="res://icon.svg"
|
|||
|
||||
window/size/viewport_width=640
|
||||
window/size/viewport_height=360
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[rendering]
|
||||
|
||||
|
|
|
|||
BIN
sprites/offline_channel.png
Normal file
BIN
sprites/offline_channel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 173 KiB |
34
sprites/offline_channel.png.import
Normal file
34
sprites/offline_channel.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cyo0wl4dt3td1"
|
||||
path="res://.godot/imported/offline_channel.png-e3e2421d42e08e33717e4084390201c9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/offline_channel.png"
|
||||
dest_files=["res://.godot/imported/offline_channel.png-e3e2421d42e08e33717e4084390201c9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://63rik2noj8id"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_iix04"]
|
||||
[ext_resource type="Script" uid="uid://dlqr0ghj0sh6a" path="res://move_test.gd" id="2_jbg2j"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_iix04"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("ViewportTexture_iix04")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
size = Vector2i(640, 360)
|
||||
|
||||
[node name="ColorRect" type="TextureRect" parent="SubViewport"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_iix04")
|
||||
|
||||
[node name="Node2D" type="Node2D" parent="SubViewport"]
|
||||
script = ExtResource("2_jbg2j")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="SubViewport/Node2D"]
|
||||
texture = ExtResource("1_iix04")
|
||||
Loading…
Add table
Add a link
Reference in a new issue