Skip to content

Commit

Permalink
Not sure it this fixes #9 but at least clear some mess
Browse files Browse the repository at this point in the history
  • Loading branch information
henriiquecampos committed Mar 6, 2018
1 parent 665885f commit bdc65e7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 43 deletions.
6 changes: 6 additions & 0 deletions screens/credit_screen/credit_screen.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends "res://screens/basic_screen.gd"

func _process(delta):
$"CreditsViewport/ParallaxBackground/ParallaxLayer".motion_offset.y -= 30 * delta
if Input.is_action_just_pressed("interact") or Input.is_action_just_pressed("jump"):
change_scene()
77 changes: 34 additions & 43 deletions screens/credit_screen/credit_screen.tscn
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
[gd_scene load_steps=9 format=2]

[ext_resource path="res://screens/basic_screen.tscn" type="PackedScene" id=1]
[ext_resource path="res://screens/splash_screen/background.png" type="Texture" id=2]
[ext_resource path="res://screens/credit_screen/logo.png" type="Texture" id=3]
[ext_resource path="res://screens/theme.tres" type="Theme" id=4]
[ext_resource path="res://screens/GaroaHackerClubeBold.otf" type="DynamicFontData" id=5]
[ext_resource path="res://screens/credit_screen/credit_screen.gd" type="Script" id=2]
[ext_resource path="res://screens/splash_screen/background.png" type="Texture" id=3]
[ext_resource path="res://screens/credit_screen/logo.png" type="Texture" id=4]
[ext_resource path="res://screens/theme.tres" type="Theme" id=5]
[ext_resource path="res://screens/GaroaHackerClubeBold.otf" type="DynamicFontData" id=6]
[ext_resource path="res://screens/credit_screen/credits_texture.tres" type="Texture" id=7]

[sub_resource type="ViewportTexture" id=3]

resource_local_to_scene = true
flags = 0
viewport_path = NodePath("CreditsViewport")

[sub_resource type="GDScript" id=2]

script/source = "extends ParallaxBackground
signal back
func _process(delta):
$ParallaxLayer.motion_offset.y -= 30 * delta

if Input.is_action_just_pressed(\"interact\") or Input.is_action_just_pressed(\"ui_accept\"):
emit_signal(\"back\")"

[sub_resource type="DynamicFont" id=1]
[sub_resource type="DynamicFont" id=3]

size = 32
use_mipmaps = true
use_filter = true
extra_spacing_top = 4
font_data = ExtResource( 5 )
font_data = ExtResource( 6 )
_sections_unfolded = [ "Extra Spacing", "Font" ]

[node name="CreditScreen" index="0" instance=ExtResource( 1 )]
[node name="CreditScreen" instance=ExtResource( 1 )]

script = ExtResource( 2 )
_sections_unfolded = [ "Rect", "Theme" ]
next_scene = "res://screens/main_screen/main_screen.tscn"

[node name="Transition" parent="." index="1"]

layer = 2

[node name="ColorRect" parent="Transition" index="0"]

margin_left = -1280.0
margin_right = -256.0

[node name="Background" type="TextureRect" parent="." index="2"]

anchor_left = 0.0
Expand All @@ -53,7 +45,7 @@ mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = ExtResource( 2 )
texture = ExtResource( 3 )
stretch_mode = 0
_sections_unfolded = [ "Rect" ]

Expand Down Expand Up @@ -89,7 +81,7 @@ mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
texture = ExtResource( 3 )
texture = ExtResource( 4 )
expand = true
stretch_mode = 6
_sections_unfolded = [ "Size Flags" ]
Expand Down Expand Up @@ -260,15 +252,9 @@ lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]

[node name="Credits" type="Sprite" parent="." index="5"]

position = Vector2( 0, 139 )
texture = SubResource( 3 )
centered = false
_sections_unfolded = [ "Offset" ]

[node name="CreditsViewport" type="Viewport" parent="." index="6"]
[node name="CreditsViewport" type="Viewport" parent="." index="5"]

editor/display_folded = true
arvr = false
size = Vector2( 1024, 360 )
own_world = false
Expand All @@ -279,7 +265,7 @@ hdr = false
disable_3d = true
usage = 0
debug_draw = 0
render_target_v_flip = true
render_target_v_flip = false
render_target_clear_mode = 0
render_target_update_mode = 2
audio_listener_enable_2d = false
Expand All @@ -292,7 +278,7 @@ shadow_atlas_quad_0 = 2
shadow_atlas_quad_1 = 2
shadow_atlas_quad_2 = 3
shadow_atlas_quad_3 = 4
_sections_unfolded = [ "Render Target" ]
_sections_unfolded = [ "Render Target", "Rendering" ]

[node name="ParallaxBackground" type="ParallaxBackground" parent="CreditsViewport" index="0"]

Expand All @@ -307,7 +293,6 @@ scroll_base_scale = Vector2( 1, 1 )
scroll_limit_begin = Vector2( 0, 0 )
scroll_limit_end = Vector2( 0, 0 )
scroll_ignore_camera_zoom = true
script = SubResource( 2 )
_sections_unfolded = [ "Scroll" ]

[node name="ParallaxLayer" type="ParallaxLayer" parent="CreditsViewport/ParallaxBackground" index="0"]
Expand All @@ -331,7 +316,7 @@ mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
theme = ExtResource( 4 )
theme = ExtResource( 5 )
_sections_unfolded = [ "Rect", "Scroll", "Theme" ]

[node name="Categories" type="VBoxContainer" parent="CreditsViewport/ParallaxBackground/ParallaxLayer/Credits" index="0"]
Expand Down Expand Up @@ -364,7 +349,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 3 )
text = "audio"
align = 1
valign = 1
Expand Down Expand Up @@ -504,7 +489,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 3 )
text = "design"
align = 1
valign = 1
Expand Down Expand Up @@ -763,7 +748,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 3 )
text = "engineering"
align = 1
valign = 1
Expand Down Expand Up @@ -845,7 +830,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 3 )
text = "graphics"
align = 1
valign = 1
Expand Down Expand Up @@ -1163,7 +1148,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 3 )
text = "special thanks to"
align = 1
valign = 1
Expand Down Expand Up @@ -1197,6 +1182,12 @@ percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

[connection signal="back" from="CreditsViewport/ParallaxBackground" to="." method="change_scene"]
[node name="Credits" type="Sprite" parent="." index="6"]

position = Vector2( 0, 139 )
texture = ExtResource( 7 )
centered = false
flip_v = true
_sections_unfolded = [ "Offset" ]


8 changes: 8 additions & 0 deletions screens/credit_screen/credits_texture.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="ViewportTexture" format=2]

[resource]

resource_local_to_scene = true
flags = 0
viewport_path = NodePath("CreditsViewport")

0 comments on commit bdc65e7

Please sign in to comment.