ClearScreen script command

This commit is contained in:
Ryan Shepherd 2018-10-11 15:50:39 -04:00
parent 3af5ced1cd
commit a9d5032b7a
3 changed files with 13 additions and 5 deletions

View File

@ -168,6 +168,13 @@ sub HideSprite {
delete $VisibleSprites{$name};
}
sub ClearScreen {
foreach (keys %VisibleSprites) {
next if($_ eq 'Background');
HideSprite($_);
}
}
sub MoveSprite {
my($name, $x, $y)=@_;
return undef unless(exists $VisibleSprites{$name});

View File

@ -34,6 +34,7 @@ my %script_commands = (
'Show' => {'sub' => \&PerlRPG::Drawing::ShowSprite, 'wait' => 0},
'Hide' => {'sub' => \&PerlRPG::Drawing::HideSprite, 'wait' => 0},
'SetBackground' => {'sub' => \&PerlRPG::Drawing::SetBackgroundColor, 'wait' => 0},
'ClearScreen' => {'sub' => \&PerlRPG::Drawing::ClearScreen, 'wait' => 0},
'ScanDirectory' => {'sub' => \&PerlRPG::Assets::ScanDirectory, 'wait' => 0},
'LoadAssets' => {'sub' => \&PerlRPG::Assets::LoadAssets, 'wait' => 0},

View File

@ -3,10 +3,10 @@ __init__:
TargetFPS = 20
drawroom:
ClearScreen
SetBackground 0 0 0 255
SetAssetOption spritesheet.png Animated
AddSayer h "Hermione" aka01.png 255 0 0 255
#AddSayer h2 "Hermione2" aka05.png 32 32 255 255 left flip
SpeechBorderSize = 3
SpeechBorderColor = "128 128 128 255"
@ -21,13 +21,13 @@ drawroom:
Show candler candle.png 400 100 11 flip
Show candlel candle.png 240 100 11
#Show fireplacea fireplace_fire.vs 575 147 12
#Show candlera fire.vs 400 95 12 flip
#Show candlela fire.vs 240 95 12
Show fireplacea fireplace_fire.vs 575 147 12 ticks=2
Show candlera fire.vs 400 95 12 flip ticks=2
Show candlela fire.vs 240 95 12 ticks=2
Show desk 11_genie_00.png 230 220 13
#Show hermione spritesheet.png 450 310 14 reverse ticks=4
Show hermione spritesheet.png 450 310 14 reverse ticks=4
convo:
Call subtest