[oden] Move scaling entirely into JavaScript
Now the game controls its own resolution. We might want to further copy Love2D and generate resize events, I don't know.
This commit is contained in:
parent
994be3e493
commit
1cb30034f8
9 changed files with 176 additions and 58 deletions
|
|
@ -154,9 +154,11 @@ impl ScriptContext {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn update(&mut self) {
|
||||
pub fn update(&mut self, dimensions: (f32, f32)) {
|
||||
let _span = span!("script update");
|
||||
|
||||
self.gfx.set_dimensions(dimensions);
|
||||
|
||||
if self.error_lines.len() > 0 {
|
||||
return; // Don't bother, nothing.
|
||||
}
|
||||
|
|
@ -190,6 +192,7 @@ impl ScriptContext {
|
|||
let _span = span!("script render");
|
||||
if self.error_lines.len() > 0 {
|
||||
// TODO: Use font 0 for a fallback.
|
||||
// TODO: Scale!! Remember you're using a font at size 8 or something.
|
||||
let mut commands = vec![
|
||||
GraphicsCommand::Clear(ClearCommand {
|
||||
color: [0.0, 0.0, 1.0, 1.0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue