|
|
|
@ -201,12 +201,27 @@ void VisualNovel::Draw(){ |
|
|
|
|
alpha=util::lerp(0,1,1-(transitionTime/maxTransitionTime)); |
|
|
|
|
} |
|
|
|
|
if(prevBackgroundFilename!=""){ |
|
|
|
|
game->DrawDecal({0,0},GFX["backgrounds/"+prevBackgroundFilename].Decal()); |
|
|
|
|
game->DrawDecal({0,0},GFX["story_background_image_location"_S+prevBackgroundFilename].Decal()); |
|
|
|
|
} |
|
|
|
|
game->DrawDecal({0,0},GFX["backgrounds/"+backgroundFilename].Decal(),{1,1},{255,255,255,uint8_t(255*alpha)}); |
|
|
|
|
game->DrawDecal({0,0},GFX["story_background_image_location"_S+backgroundFilename].Decal(),{1,1},{255,255,255,uint8_t(255*alpha)}); |
|
|
|
|
}else{ |
|
|
|
|
game->FillRectDecal({0,0},game->GetScreenSize()); |
|
|
|
|
} |
|
|
|
|
for(int i=leftCharacters.size()-1;i>=0;i--){ |
|
|
|
|
//Start 72 from the bottom.
|
|
|
|
|
std::string character=leftCharacters[i]; |
|
|
|
|
Pixel fadeColor=WHITE; |
|
|
|
|
if(character!=actualSpeakerName)fadeColor={128,128,128,255}; |
|
|
|
|
game->DrawDecal(vi2d{0,game->GetScreenSize().y}-vi2d{-i*64,72+168},GFX[GetCharacterImage(character)].Decal(),{1,1},fadeColor); |
|
|
|
|
} |
|
|
|
|
for(int i=rightCharacters.size()-1;i>=0;i--){ |
|
|
|
|
//Start 72 from the bottom.
|
|
|
|
|
std::string character=rightCharacters[i]; |
|
|
|
|
Pixel fadeColor=WHITE; |
|
|
|
|
if(character!=actualSpeakerName)fadeColor={128,128,128,255}; |
|
|
|
|
float spriteWidth=GFX[GetCharacterImage(character)].Sprite()->width; |
|
|
|
|
game->DrawRotatedDecal(game->GetScreenSize()-vi2d{i*64+int(spriteWidth)/2,72+168},GFX[GetCharacterImage(character)].Decal(),0,vf2d{spriteWidth/2,0.f},{-1,1},fadeColor); |
|
|
|
|
} |
|
|
|
|
if(locationDisplayTime>0){ |
|
|
|
|
vi2d textSize=game->GetTextSizeProp(locationDisplayText)*2; |
|
|
|
|
game->FillRectDecal(game->GetScreenSize()/2-textSize/2-vi2d{4,4},textSize+vi2d{8,8},BLACK); |
|
|
|
@ -226,6 +241,12 @@ void VisualNovel::Draw(){ |
|
|
|
|
game->DrawShadowStringPropDecal(dialogDisplayPos-vf2d{10,10},activeText); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
std::string VisualNovel::GetCharacterImage(std::string name){ |
|
|
|
|
if(name=="You"){ //Assume we are using female player avatar for now!
|
|
|
|
|
return "character_image_location"_S+"Player_F.png"; |
|
|
|
|
} |
|
|
|
|
return "character_image_location"_S+name+".png"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VisualNovel::VisualNovel(){} |
|
|
|
|
|
|
|
|
|