cover half of the viewport during credits
This commit is contained in:
parent
bdc4e7d209
commit
f3a87259a1
|
@ -39,6 +39,9 @@ impl GameEntity<()> for Credits {
|
|||
}
|
||||
|
||||
fn draw(&self, state: &mut SharedGameState, ctx: &mut Context, _frame: &Frame) -> GameResult {
|
||||
let rect = Rect::new(0, 0, (state.screen_size.0 / 2.0) as _, state.screen_size.1 as _);
|
||||
graphics::draw_rect(ctx, rect, Color::from_rgb(0, 0, 32))?;
|
||||
|
||||
if state.textscript_vm.illustration_state != IllustrationState::Hidden {
|
||||
let x = match state.textscript_vm.illustration_state {
|
||||
IllustrationState::FadeIn(x) | IllustrationState::FadeOut(x) => x,
|
||||
|
@ -49,9 +52,6 @@ impl GameEntity<()> for Credits {
|
|||
let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, tex)?;
|
||||
batch.add(x, 0.0);
|
||||
batch.draw(ctx)?;
|
||||
} else {
|
||||
let rect = Rect::new_size((x * state.scale) as isize, 0, (160.0 * state.scale) as _, state.screen_size.1 as _);
|
||||
graphics::draw_rect(ctx, rect, Color::from_rgb(0, 0, 32))?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1536,6 +1536,10 @@ impl TextScriptVM {
|
|||
}
|
||||
TSCOpCode::SIL => {
|
||||
let number = read_cur_varint(&mut cursor)? as u16;
|
||||
log::warn!("<SIL{:04}", number);
|
||||
|
||||
state.textscript_vm.current_illustration = None;
|
||||
state.textscript_vm.illustration_state = IllustrationState::FadeIn(-160.0);
|
||||
|
||||
for path in state.constants.credit_illustration_paths.iter() {
|
||||
let path = format!("{}Credit{:02}", path, number);
|
||||
|
@ -1545,11 +1549,10 @@ impl TextScriptVM {
|
|||
}
|
||||
}
|
||||
|
||||
state.textscript_vm.illustration_state = IllustrationState::FadeIn(-160.0);
|
||||
|
||||
exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32);
|
||||
}
|
||||
TSCOpCode::CIL => {
|
||||
log::warn!("<CIL");
|
||||
state.textscript_vm.illustration_state = if let Some(_) = state.textscript_vm.current_illustration {
|
||||
IllustrationState::FadeOut(0.0)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue