agb icon indicating copy to clipboard operation
agb copied to clipboard

Allowing imported graphics to be exposed as `pub mod`

Open kouta-kun opened this issue 1 year ago • 2 comments

I would like imported graphics in a module to be (optionally) exposed as pub mod and be used from other modules than the one it was imported in.

I already have a POC of it in this fork but the README mentions that an issue should be opened first for discussion :)

kouta-kun avatar Jul 07 '24 00:07 kouta-kun

To unblock, you can achieve this now using re-exports. For example:

pub mod bg {
   agb::include_background_gfx!(backgrounds, "FFFFFF", some_map => "some-data.aseprite");

   pub use backgrounds::*;
}

corwinkuiper avatar Jul 07 '24 01:07 corwinkuiper

From the code it seems you do pub backgrounds in @corwinkuiper's example above? I think that makes perfect sense, so happy for you to PR that as well :).

gwilymk avatar Jul 09 '24 18:07 gwilymk

Added in 0.21.0

gwilymk avatar Oct 15 '24 19:10 gwilymk