-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doryen_rs merge #77
Comments
Thanks for that! I'll see what I can do. |
Re: Minimizing I'd love to have an option to pause the game loop when minimized, but it's going to be tough to make that work with back-ends other than OpenGL/native. There might be a hook for WASM, but I'm pretty sure Curses and Crossterm won't tell me if the parent terminal is minimized (I'll have to look in Amethyst; pretty sure I remember seeing that somewhere). |
Re: not updating unless cls is called There's a new example, |
Re: WASM not working The current MASTER build (now includes local paths for easier building) is compiling fine for me, now. There was an issue with some code from a PR not updating the WASM tree correctly. I'm pretty sure that one is fixed. |
I still can't make WASM target work. I'm using a cloned bracket-lib on master (commit 9a4d7fe) and run : > cd bracket-lib/bracket-terminal
> cargo web start --example keyboard I'm using the latest rust 1.41.1 and cargo-web 0.6.26 and tested on both firefox 73.0.1 and chromium 69.0. I get the same error in both :
What is it you're doing different from me ? |
Concerning the new input API, I'm back to my previous issue. Providing the existing doryen-rs API using bracketlib would require to copy all input state from bracketlib to another object because I can't pass the impl Doryen {
// function called by the users of doryen-rs library
pub fn key_pressed(scan_code: u32) -> bool {
// can't do that without a reference to &mut BTerm
// or having all BTerm state copied in Doryen
}
}
impl GameState for Doryen {
fn tick(&mut self, ctx: &mut BTerm) {
...
}
} There may be other solutions, but passing a Rc<RefCell> in tick would work: impl Doryen {
pub fn key_pressed(scan_code: u32) -> bool {
self.ctx.borrow().input.is_scancode_pressed(scan_code)
}
}
impl GameState for Doryen {
fn tick(&mut self, ctx: Rc<RefCell<BTerm>>) {
self.ctx=ctx.clone();
}
} |
Tangential, I just discovered glow does support WebGL 1 context and that floating point framebuffer isn't explicitly an WebGL2 thing... could we maybe get a fallback to WebGL1, please, for people stuck with MS Edge? |
The |
…e/context directly and to the command buffer.
… name. Terminals now support a printer function for strings such as '#[blue]This blue text contains a #[pink]pink#[] word'. Also available in the command buffer.
The last bundle of commits added:
|
… parent console. Put whatever you like in it. Submit it to a real console with print_sub_rect or a render batch (batch_sub_rect). Supports all of the formatting/options of other terminal types. Should serve as a basis for sub-consoles if you don't feel TextBlocky.
Virtual Terminals are kind-of a compromise. I needed a way to handle consoles much bigger than the screen and view "windows" into them. It isn't "owned" or "attached" to a real console in any way - so you can make it and keep it around, without having it touch the underlying engine state until you need it. Submission (via render batch or direct to context) works on any target console (whatever is active). So if you have multiple layers, you can splat it to a sparse top layer and have it partially apply (alpha isn't supported yet) - ideal for putting your HUD onto the screen. If a glyph has a value of 0, it isn't copied: so you can leave holes in it if you want to. Once consoles support alpha, this will let you put nicely faded elements such as tool-tips on top of your main display (on systems that support alpha, obviously). |
The Update: Amethyst and WASM are working too! Just need to improve the interface a little. Example: https://bfnightly.bracketproductions.com/wasmtest/alpha/ |
I forgot to mention that The same setup is used for the tiles example: https://bfnightly.bracketproductions.com/wasmtest/tiles/ Font files still have to be arranged 16 tiles per row, with 16 rows (to give 255 characters) - but they can be anything you want (you'll wind up accessing them by number). I'll see about relaxing that restriction and improving the mapping in a future update. I have a few related ideas I've been bouncing around, so it'll be a feature branch once |
RGBA is now merged. I added more conversions and unit testing to |
…se was also setting it, not unsetting it.
I'm closing this as pretty much all the major features have been imported to bracket-lib. What an amazing coding spree ! Congratulations :) |
I'm creating this issue to track work related to merging doryen_rs and bracket-lib.
Items that eventually require work in bracket-lib will have their dedicated issue.
WASM
Windowing
BTerm::save_screenshot(file_path: &str)
The text was updated successfully, but these errors were encountered: