testing bg stuff
This commit is contained in:
parent
50dbda5f27
commit
05b6bdb73b
|
@ -1,10 +1,19 @@
|
|||
extends Node2D
|
||||
|
||||
var bg_sprite
|
||||
|
||||
signal on_scene_ready
|
||||
signal on_scene_start
|
||||
|
||||
func _ready():
|
||||
|
||||
# internal state
|
||||
var new_sprite = Sprite.new()
|
||||
new_sprite.name = "background"
|
||||
new_sprite.centered = false
|
||||
add_child(new_sprite)
|
||||
bg_sprite = new_sprite
|
||||
|
||||
if not Game.game_started:
|
||||
Game.game_started = true
|
||||
emit_signal("on_scene_ready")
|
||||
|
@ -15,3 +24,6 @@ func _ready():
|
|||
|
||||
func on_scene_start():
|
||||
emit_signal("on_scene_start")
|
||||
|
||||
func set_background(bg_tex):
|
||||
bg_sprite.texture = bg_tex
|
|
@ -1,3 +1,4 @@
|
|||
> SET_BACKGROUND [INTRO_BG]
|
||||
<BRAIN> ... You wake up to the sound of sirens blaring.
|
||||
... maybe it's time to go to school?
|
||||
> SWITCH_SCENE [FIRST_SCENE]
|
||||
|
|
18
game.gd
18
game.gd
|
@ -21,8 +21,6 @@ signal on_reading_speed_changed(new_value)
|
|||
signal on_settings_enter()
|
||||
signal on_settings_exit()
|
||||
|
||||
const Themes = {}
|
||||
|
||||
# voices for characters
|
||||
const brain_voice = null
|
||||
const arborator_voice = null
|
||||
|
@ -55,8 +53,24 @@ const Scenes = {
|
|||
|
||||
}
|
||||
|
||||
const Themes = {}
|
||||
|
||||
const Images = {
|
||||
INTRO_BG = "res://img/intro_bg.png"
|
||||
}
|
||||
|
||||
func _register_functions():
|
||||
|
||||
# default VN.. functions
|
||||
current_registry["SWITCH_SCENE"] = funcref(self, "_switch_scene_fnc")
|
||||
current_registry["SET_BACKGROUND"] = funcref(self, "_set_background_fnc")
|
||||
|
||||
|
||||
func _set_background_fnc(args):
|
||||
if args.size() == 1:
|
||||
var bg_name = args[0]
|
||||
var bg_texture = load(Images[bg_name])
|
||||
SceneSwitcher.current_scene.set_background(bg_texture)
|
||||
|
||||
func _switch_scene_fnc(args):
|
||||
if args.size() == 1:
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,29 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/intro_bg.png-365e7af536365a75b19afe8d8934b7d7.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://img/intro_bg.png"
|
||||
dest_files=[ "res://.import/intro_bg.png-365e7af536365a75b19afe8d8934b7d7.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
|
@ -8,9 +8,7 @@
|
|||
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="background" type="Sprite" parent="." index="0"]
|
||||
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="." index="1"]
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="." index="0"]
|
||||
|
||||
layer = 0
|
||||
offset = Vector2( 0, 0 )
|
||||
|
|
|
@ -84,7 +84,7 @@ group = null
|
|||
text = "auto"
|
||||
flat = true
|
||||
align = 1
|
||||
_sections_unfolded = [ "custom_constants" ]
|
||||
_sections_unfolded = [ "custom_colors", "custom_constants" ]
|
||||
|
||||
[node name="ffwd_btn" type="Button" parent="top_panel" index="1"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue