jkb0o / belly Goto Github PK
View Code? Open in Web Editor NEWDefine the Bevy UI tree with `eml!`, style it using a very-css-like `ess` syntax and relate data data with `bind!` and `connect!`
License: Apache License 2.0
Define the Bevy UI tree with `eml!`, style it using a very-css-like `ess` syntax and relate data data with `bind!` and `connect!`
License: Apache License 2.0
In 9040fac Variant::Any
was introduced. It looks like the common way to pass params and style defaults to nodes. It is required to impl TryFrom<Variant> for T
and impl From<T> for Variant
for builtins & bevy types, adopt Property
to this approach and coordinate Variant
with PropertyValues
.
There is a conflict with the syn package
The party-editor
example spawns a lot of entities and FPS is really low. The reasons are still unclear, but the main suspects have been identified:
After adding some eml to my program, the program starts allocating memory like crazy. I've been able to reproduce the problem when you attach eml, which has a base component with (a) child eml component(s) (like a div or a label), to an entity, like as shown below.
let entity = commands.spawn_empty().id();
commands.add(eml! {
<div {entity}>
<div>"this is a test!"</div>
</div>
});
I'm using linux, but I've also replicated the problem on another windows machine.
If you do not attach it to an entity or do not add a child component, the runaway memory allocation does not occur.
With heaptrack, I've diagnosed this issue to be when adding to an ElementsBranch in belly_core::ess::property::Property::apply_defaults. (presumably after line 307)
Here is a zip containing the heaptrack file (which heaptrack already compressed into a zst, but github does not support zsts)
For now it is possible to loop somehow with .elements()
iterator:
{["fit", "cover", "stretch", "source"].iter().elements(|mode| {
eml!(
<button value=mode>{mode}</button>
)
})}
This approach has two issues:
eml!
which adds unnecessary calculationsLooks like there is possible to implement <for>
loop at the macro level:
<for mode in=["fit", "cover", "stretch", "source"]>
<button value=mode>{mode}</button>
</for>
For now there are only subset of html widgets implemented. When I wrote examples, I constantly lacked an easy way to define the layout (like put this in the center, and this in row, etc). It looks pretty useful to provide out-of-the box layout widgets with predefined styles:
<center>
places children in the center. Possible defaults:center {
justify-content: center;
align-content: center;
}
<row>
places children in a row. Possible defaults:row {
flex-direction: row;
justify-content: space-around;
align-content: center;
}
<column>
places children in a column. Possible defaults:column {
flex-direction: row;
justify-content: space-around;
align-content: center;
}
<wrap>
places children wrapped. Possible defaults:column {
flex-wrap: wrap;
}
row
/column
widgets should provide the way to control main/opposite axis behaviour with attributes.
To control main-axis behaviour I suggest to use "space" attribute (where to put spaces on the main axis):
<row space="between">...</row>
The possible values are:
around
for JustifyContent::SpaceAround
between
for JustifyContent::SpaceBetween
even
for JustifyContent::SpaceEvenly
end
for JustifyContent::FlexStart
start
for JustifyContent::FlexEnd
outside
for JustifyContent::Center
To control opposite-axis behaviour I suggest to use "align" attribute:
<column space="start" align="center">...</row>
space-around
for AlignContent::SpaceAround
space-between
for AlignContent::SpaceBetween
space-even
for JustifyContent::SpaceEvenly
start
for JustifyContent::FlexStart
end
for JustifyContent::FlexEnd
center
for JustifyContent::Center
I don't what attributes should be provided for <center>
/<wrap>
. Suggest and argue or left them empty.
It would be cool if the widget attributes turned out to be bindable and manageble (imposible to change via ess).
The complex examples (color-picker
, image
) and README should be taken into account (edit examples/readme to use this widgets).
The version of bevy-inspector-egui this relies on depends on bevy 0.8, causing duplicate compilation of many crates
├── belly v0.1.0 (https://github.com/jkb0o/belly?branch=main#9c5b154e)
│ ├── belly_core v0.1.0 (https://github.com/jkb0o/belly?branch=main#9c5b154e)
│ │ ├── bevy v0.9.1 (https://github.com/laundmo/bevy?branch=bevy_0.9_overlay#0ff16963)
│ │ │ └── bevy_internal v0.9.1 (https://github.com/laundmo/bevy?branch=bevy_0.9_overlay#0ff16963)
│ │ ├── bevy-inspector-egui v0.13.0
│ │ │ ├── bevy v0.8.1
belly/crates/belly_core/Cargo.toml
Line 10 in 9c5b154
For not the bind macro is a total mess. It should be rewritten using $tt
captures or even into #[proc_macro]
.
https://github.com/1egocy/bevy_elements/blob/a479838ec1b749b2cb597544ef91ef33cca237ad/bevy_elements_core/src/bind.rs#L392-L504
For now, there is no way to list supported properties. It is possible to generate some md file and/or doc crate or mod with list of all provided props.
For now Property
define the name, the way it should be parsed and the way it should be processed. This makes impossible to provide different implementations for modulate
property, for example, which should have different systems for different nodes (img
and stylebox-related
).
The idea is to move name
, type
and parser
parts to the Property
and system parts to the PropertySystem
that type alias Property
.
But I'll check this one, it shouldn't be too difficult to bypass requested resources to `run!` handler.
Originally posted by @jkb0o in #57 (comment)
For now slider widget can be controlled only by dragging slider with mouse. The main missed thing is the ability to change the slider value when the bar got pressed outside the slider.
Updated rust with rustup-update and now cargo check fails (message follows, it's quite long)
After I:
"cargo run" still works, for some reason.
I refer to your project in cargo.toml using path to the directory.
EDIT:
Now cargo run fails as well with the same message.
EDIT: the belly project itself compiles with no errors
EDIT: I noticed that all Cargo refers to Bevy 0.10 and not 0.10.1? couldt that be the problem?
Here is the message:
Compiling belly_macro v0.2.0 (/home/mikkel/src/rust_libs/belly/crates/belly_macro) error: linking with
clang` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/mikkel/.local/bin:/home/mikkel/.cargo/bin:/home/mikkel/.nvm/versions/node/v12.21.0/bin:/home/mikkel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mikkel/.dotnet/tools:/home/mikkel/.dotnet:/home/mikkel/.apps/Lapce:/usr/local/go/bin:/home/mikkel/apps/WebStorm-211.7442.26/bin:/home/mikkel/.dotnet/tools:/home/mikkel/apps/dotnet-tools:/home/mikkel/.bin:/home/mikkel/.cargo/bin:/home/mikkel/.apps/Lapce:/home/mikkel/.dotnet:/home/mikkel/.apps/Lapce:/usr/local/go/bin:/home/mikkel/apps/WebStorm-211.7442.26/bin" VSLANG="1033" "clang" "-Wl,--version-script=/tmp/rustc5wPeZ1/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustc5wPeZ1/symbols.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.102jvfu1aqjb4uyk.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.10jhwp8u33rvhnja.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.15jhsqu6z1cdsh7d.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1966lyrzdfszetbb.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1ehxlscs6oc7jwl8.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1g723thwswsoghad.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1lu6j2eqetcekux6.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1s7fs5gkbvtux8ri.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.1yzw3iabvqd21f4r.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.209mi7bctqphi3kq.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2aa1q5xn5foejziz.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2cqhw3zdrsr20k7f.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2crika5m9dq0wd5z.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2fipewnr5z27f17v.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2fplx519brswiijy.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2gf8b533ufd1rlgl.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2iuuw8xau517bprt.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2iyxbg2re8y05juq.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2n9989wuoa3vmrxz.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2pq49tu96485nub1.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2rirlrr9afr4w514.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2s2jdby9kaetf5ea.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.2u8bfkc464jft3tk.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.31vxpzwdgqzyiwt6.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.34gkanu3deshbiv1.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3awrsfonsfohmdlv.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3il24gkmxqf6wyne.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3kdvyn8jp28jy7ey.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3ld6gmyh7ptn6nz8.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3mx2s40x1bitoxn4.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3sfx0mgkobhidjn7.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3sndtb67onoicbs9.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3xdnfqvx58406826.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.40vnfzj9lprnry7k.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.463u1b4aehn3yknu.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4d3by19dhkl94zqn.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4gq01fvqovj2k2zc.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4jwailypo7bp5xri.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4m2b6rcjbf159qcv.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4s0myo66kkt34qlg.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.4wedohld4d0zjfe8.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.50v9lmy633c4nobp.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.5dbwv3z60o69bh6v.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.5gruaswbmo8muvia.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.5se0np6nul9qkq8.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.ggt7i3rtc23qnui.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.nl67hz32ij0btkh.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.uh80x568nkdgkla.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.v3bsaga7b6zslr7.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.wujcn4kzrsai9al.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.xmpybddse22f7f7.rcgu.o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.3yxbjllyr01q0uyl.rcgu.rmeta" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/belly_macro-23a6d39d48127db5.32i91q8no1wuf83t.rcgu.o" "-Wl,--as-needed" "-L" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/lib/x86_64-linux-gnu" "-L" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtoml-abe38bb3d069d92a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy-f1d2c9594439817e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_internal-d41741cd3cb1695d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_winit-b2700fbe4a4d4089.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libaccesskit_winit-588f0b7c06a122cf.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwinit-c556da005ff509b7.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libx11_dl-9e83d45f8e2d04a5.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_ui-4c65e00dcb5fffe8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtaffy-123995134faf3d17.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libslotmap-d63c68308ed310ef.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_text-695f8293843a8da4.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libglyph_brush_layout-e15f8fd63060458b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libxi_unicode-50d0cd768e0488a0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libapprox-8fefbd7687f55b6a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libab_glyph-0eda4ccb7327bedd.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libowned_ttf_parser-52843994d5348a0f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libttf_parser-e4e331680794fdde.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libab_glyph_rasterizer-3037a6b764180f9c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_sprite-f4998e07b7746d83.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/librectangle_pack-40a710768b75fcca.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libguillotiere-de57d1943ff0f38c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsvg_fmt-3fcaaa9d84b205d2.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libeuclid-de20f752d130f5eb.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_gltf-13368e76fc89c25e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libpercent_encoding-26a33ee0fc965521.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgltf-d123e90524d38aaf.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgltf_json-476ee6fa2f83dab1.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libserde_json-7ab169692f3b1a8e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libryu-3f60c4d1c9d1492b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libitoa-5115d27a7dcc982b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_pbr-fca7f00ec9ea97e9.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_gilrs-11fa904e2329646e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgilrs-d57a3b3d49993025.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfnv-f014576fbda9b3d2.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgilrs_core-b5fc690c801ec946.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblibudev_sys-29bf843ad4a34611.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnix-f2987516ef01d83e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libvec_map-c25bb4879f9b9216.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_core_pipeline-205262a6b126d308.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libradsort-dbab9989b8616dad.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_audio-c2fcefa44f5d364b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/librodio-ee7a8f9ed1b02314.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblewton-126e62866c9c552e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libogg-b54415ed4bb8f400.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtinyvec-cf7dcfa105910ee8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtinyvec_macros-a6b3d9312def2b22.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcpal-7a2d072c3bbbc67b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libdasp_sample-81e2f86a3b1f2179.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libalsa-e8b18c3f82ea235f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnix-78678a931bb28db6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libalsa_sys-97e2bf63beed1dca.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_animation-c9c30e6f300c2b16.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_scene-ea0ab838939bfde8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libron-b68ecfc61a10ad18.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbase64-f53c04211337ed50.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_render-6eb04775d9da5330.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libruzstd-65fe5c3e1e39a3e0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtwox_hash-a3386e87608d54c8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_mikktspace-66187453bd508fc8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libimage-0d87fa4b9ff03e11.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcolor_quant-2bc4177b65baf732.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libpng-c6e88cc2054e8d3e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libflate2-439a346fe9bd3eba.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libminiz_oxide-4c9ec4f46955d96b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libadler-c149df622771fab3.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcrc32fast-ef831fbbb76f8b5f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnum_rational-771dfb04d5994628.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnum_integer-9dcd88b15ac6efde.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libscoped_threadpool-46d31ae2838db45c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libktx2-406c24b121b4256e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libencase-f2922e13d18ad955.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libconst_panic-28e78e4afcfe3843.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libhexasphere-db262a8d1c4a2f3c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwgpu-4544d1f530dc1204.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libstatic_assertions-274eb117f0812afb.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwgpu_core-c940e410d50b17b4.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwgpu_hal-e1e5db83390f4136.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/librenderdoc_sys-86fcf1b3e723e5f1.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgpu_descriptor-7861c2aae004727c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgpu_descriptor_types-14c5303cc45364e9.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfxhash-f7784c700e7b2ac0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbyteorder-eb09bbcab703b29e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libkhronos_egl-bee05d9739664a06.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libprofiling-cdbf9c0e12c204e0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgpu_alloc-08fd04ff60832efe.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgpu_alloc_types-926314f4222b13da.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libash-3cceb64af40a4101.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblibloading-09036ad2e27c488b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnaga-f57a80abed1f76c2.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libhexf_parse-75607ede617c76ef.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbit_set-28d6c58542e7f473.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbit_vec-bfa471ea8b6a4c8d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcodespan_reporting-424ef451e7a5e82a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libunicode_width-4525f315ba2e5041.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtermcolor-be965c4bbf59eb39.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libpp_rs-cf85160633286750.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libunicode_xid-d5f57a455e4c56b3.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libspirv-64ebe452f147ec1b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnum_traits-159694d43d2ab763.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwgpu_types-bde2f197f4f38273.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libglow-d7fe39bad2e4bd98.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libarrayvec-2350c2db791702d1.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_window-973e35d4d9b2ef89.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libraw_window_handle-7b64e4d498b7b6ba.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_transform-357b0c0a1833ee94.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_hierarchy-c6c4eb577597517d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_input-db01536caf2f395f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_asset-47bf08e462edae88.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnotify-f8c055a8b0b494bc.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libmio-30f9bba5db856315.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfiletime-e0b8c06c32e6aff0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwalkdir-12a1f2dcfb4f2375.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsame_file-3c619fe06bfae504.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libinotify-af59b00f62417607.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libinotify_sys-9748bf2ce8f615e0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbitflags-f55f494080e12345.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_diagnostic-8c39e9f4fa45fce3.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsysinfo-9345b4a7cee4cf61.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_time-f0649bbbc298f488.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_core-b48d14e15aaab990.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcrossbeam_channel-cf44627f1560b5a6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_log-6baa98bb7c0712d6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtracing_subscriber-1a3d8b6f8ace3769.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libnu_ansi_term-71f96e13fbb6cb47.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liboverload-31173fa4612bc227.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsharded_slab-cd5d064e77e20e18.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libmatchers-8c420a3cb3324f1e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libregex_automata-b6f1bd5198644c04.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libregex-1398164ba8ff6893.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libaho_corasick-76749d958832062a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libregex_syntax-edb80cf57e33be3b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtracing_log-d092fc4ac3aa5ab8.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblog-d067a1c2132c105d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblazy_static-54f54b7cab391faa.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libanyhow-50b160c7283a97de.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_a11y-1d4b79831742680a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libaccesskit-87d107fd5f922672.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_app-87d47243d957cd15.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_ecs-ae70eebdebbd6609.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/librustc_hash-4ec3dc347fab2554.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libthread_local-15ca0dc921a38308.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_reflect-6c18d416d662dceb.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liberased_serde-7b1bfadaab6ea843.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_math-dc1a90e0d8b1b8c9.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libglam-e74103aad4b298f1.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbytemuck-c50b5b67ad761de6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libparking_lot-a7fff2a3cd4c5a3e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libparking_lot_core-34483f2829fc25f5.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsmallvec-e7180bb79349f26c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblock_api-48e70d829b5a276f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libscopeguard-9e77229ec139fe3a.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libdowncast_rs-9cf8edb9e2a0a4fc.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_tasks-f50c4e213a50af2e.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libasync_channel-10aa96fd14c07169.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libasync_executor-7397062d18dda6a0.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libslab-bef9f96c4f07bd0f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libasync_lock-3d129fdea8d4ed4b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libevent_listener-016f0e71e3e24e01.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfutures_lite-2db3ce68334e18d6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libmemchr-065751f8ba9b8ca6.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfastrand-c154306d418b74d3.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfutures_io-bebfab6d9fe6d1ec.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfutures_core-214ecd968cf97d29.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libwaker_fn-eed2c725d2cbe205.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libparking-d0ca00410a73225b.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libconcurrent_queue-413932713f17382f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcrossbeam_utils-03df34a65e4c4b72.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libasync_task-2ec3274cf4fe45ea.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_ptr-c42404c542c20cd5.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbevy_utils-bd71e168e148830c.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libuuid-a6e112c433b64b9f.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtracing-ad43bcb904ae99bd.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libpin_project_lite-445c0881a1fae378.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libtracing_core-a7a6f14e635f7b81.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libpetgraph-1535d00bcf2d2828.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libindexmap-a2db6116a71548d2.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libfixedbitset-63ca9c265a37375d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libinstant-e50fed77d9e4eee9.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libhashbrown-f03615f9dd6e4c44.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libserde-02ebac59711b3883.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libahash-30516dd6b252969d.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libgetrandom-bd29a7b6375e60c7.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/liblibc-56c71b0f11ba7af7.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libcfg_if-07d5b17282c4b792.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libonce_cell-c8993a840af10004.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsyn_rsx-cfd008cb67bceeb9.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libthiserror-f0ca5820c6122324.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libsyn-c39545b57e1d46cd.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libquote-0e1c8a10706f13f4.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libproc_macro2-ce3e245b12bced07.rlib" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libunicode_ident-04c3968ed4f4768f.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-6768cf44411fd037.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cd20bc9d771091ea.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e09f867968bd88e3.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-fd705a60736c3357.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c0ff7ddb2987d8da.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-c459f8b0a64f04e1.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c2d64f918d4b26ad.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d22c51811a78dc80.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-328f43c2abce5784.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-c6524d8077d4ee9d.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-45ff23c614a38f1d.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-6b9410c3805b4c08.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6deb8c633abe47e3.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-daa91946230a4443.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-0b7d1529f62927c0.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c2c050aec00eb6da.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-522518611024dce5.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-05898138a596088a.rlib" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-35b8a4bd2de4e62e.rlib" "-Wl,-Bdynamic" "-ldl" "-ludev" "-lasound" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/mikkel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/mikkel/src/ob3d_rust/rust/target/debug/deps/libbelly_macro-23a6d39d48127db5.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-fuse-ld=lld"
= note: ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_begin_pipeline_statistics_query' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_dispatch_workgroups' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_dispatch_workgroups_indirect' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_end_pipeline_statistics_query' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_insert_debug_marker' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_pop_debug_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_push_debug_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_set_bind_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_set_pipeline' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_set_push_constant' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_compute_pass_write_timestamp' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_draw' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_draw_indexed' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_draw_indexed_indirect' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_draw_indirect' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_insert_debug_marker' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_pop_debug_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_push_debug_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_set_bind_group' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'wgpu_render_bundle_set_index_buffer' failed: symbol not defined
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile belly_macro
(lib) due to previous error
warning: build failed, waiting for other jobs to finish...
`
i have added belly as a git dependency with the goal of testing it. After copy-pasting the hello_world example, it failed to build since the eml!
macro expands to relying on belly_core directly, which is not available in the scope.
error[E0433]: failed to resolve: could not find `belly_core` in the list of imported crates
--> examples\belly_hello_world.rs:14:18
|
14 | commands.add(eml! {
| __________________^
15 | | <body s:padding="50px">
16 | | "Hello, "<strong>"world"</strong>"!"
17 | | </body>
18 | | });
| |_____^ could not find `belly_core` in the list of imported crates
|
= note: this error originates in the macro `eml` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: could not find `belly_core` in the list of imported crates
--> examples\belly_hello_world.rs:15:25
|
15 | <body s:padding="50px">
| ^^^^^^ could not find `belly_core` in the list of imported crates
error[E0433]: failed to resolve: could not find `belly_core` in the list of imported crates
--> examples\belly_hello_world.rs:14:18
|
14 | commands.add(eml! {
| __________________^
15 | | <body s:padding="50px">
16 | | "Hello, "<strong>"world"</strong>"!"
17 | | </body>
18 | | });
| |_____^ not found in `belly_core`
|
= note: this error originates in the macro `eml` (in Nightly builds, run with -Z macro-backtrace for more info)
It is possible to apply bind changes over time with tweening functions (sine, cubic, in/out, etc). This looks like a basic requirement for implementing ess
transitions.
Suggested API:
commands.add(
from!(entity, Component:property) >> to!(entity, Component:property)
.trans(0.25)
.cubic()
.in()
)
It would be super-nice if transition blending also is implemented.
For now you can bind only values of the same type:
bind!(player, Player.name => name, Label.value)
The Player.name
and Label.value
are string types.
It should be possile to provide some transformer to the bind:
bind!(player, Health.value => |v| format!("Health: {}", v) => label, Label.value)
While the general form should cover all cases, I believe the format!
is the most often scenario, so bind!
macro should treat string literals as format. The previous example will looks like this:
bind!(player, Health.value => "Health: {}" => label, Label.value)
From my point of view, transformers should be a part of BindTo
only, but looks like it is much simpler to make them a part of BindFrom
, at least as the first step.
So I was just looking through the examples, and it looks really nice with nice layouts, hot-reloading of themes and such. Very sweet!
But I found all ui:s to be using the entire window basically, and was wondering what would be a recommended way to create "windows" or "on-demand" UI elements.
Ill say what my usecase is to clarify what I am trying to ask for.
I have a 3D scene, with entities with meshes, and materials etc.. When selecting an object using bevy_mod_picking (for example) I want to pop up a color picker ( like the one in your example) and size slider. And have that widget only be visible when an object is selected, then removed when unselected.
I might be mixing features/concepts, like that the window is actually a widget, and hiding and showing it is a matter of spawning/despawning that widget?
But was a bit curious if there is a planned/best practice way of doing this :)
I want to have buttons that when clicked change the state of my game, is it possible to pass the NextState resource in so that I can change it when the button is pressed? I saw you can go the other way with the from!() and update a component from a resource but saw no way to update a resource from a component
<for tab in = Tab::iter()>
<button c:tab with=tab on:press=run!(|tab: &Tab, next: mut ResMut<NextState>| next.set(*tab))>
<img c:icon src=tab.icon()/>
</button>
</for>
Is is nothing documented now. The minimum things should be documented:
Will this be available for bevy 0.10?
Hi !
Belly is really nice already very pleasant to use, but how can you set the font size ?
I tried using font_size
in an ess file but I get Error: Unsupported property: font_size
I looked through the code & the docs but could not find anything.
thanks in advance !
For now, widgets consists of other widgets. <button>
, for example expands inso several primitives:
<span c:button interactable>
<span c:button-shadow s:position-type="absolute"/>
<span c:button-background>
<span c:button-foreground>
{content}
</span>
</span>
</span>
The strength of this pattern is that user can build widget of existed widgets.
The weakness is that it is easy to redefine style unintentionally:
<style>
span { padding: 20px; }
</style>
<body>
<button><span>Hello!</span></button>
<body>
The expectations of the above example are that the span with Hello
will have custom padding.
In practice all spans are implicitly redefined, even inside button.
While it is already possible to provide styles that do not redefine button's spans, it is still not obivous.
The idea is to add separate axis that can split elements defined in widgets, and other elements: tag namespace.
User should be able to specify namespace when he adds tag to eml
and specify what namespace to query via ess
selector.
We can assume that there is already namespace defined: general
namespace. All tags belongs to general namespace. And all ess
selectors queries this namespace.
The obvious solution to specify namespaces in eml
is to declare namespace before tag using :
token, just like xml does:
<!-- tag inside default namespace -->
<span>Hello</span>
<!-- tage inside widget (w) namespace -->
<w:span>Hello</w:span>
For selecting namespaces via ess
I suggest to use :ns(namespace)
notation:
/* querying general namespace */
span { }
/* querying widget (w) namespace */
span:ns(w) { }
/* querying any namespace */
span:ns(*)
For now only components could be binded:
bind!(player, Player.name => name, Label.value)
The Player
and Label
are Component
s.
It is possible to implement binds for resources:
bind!(MainPlayer.health => health_widget, ProgressBar.value);
bind!(MainPlayer.max_health => health_widget, ProgressBar.max_value);
I suggest this new naming convention:
BindFrom
-> BindFromComponent
BindTo
-> BindToComponent
BindFromResource
BindToResource
For now there is no default stylesheet, so any style should be defined by hand: https://github.com/1egocy/bevy_elements/blob/b76d118c089517d1f6c4255049ac124154096568/examples/scene.rs#L19-L25
It would be cool if some ess
defaults were set.
Hello again !
Is it currently possible to do bindings to properties directly ? (ie not in a for loop)
More specifically I was looking for a way to control the display
property with a binding (to selectively hide some parts of the ui, ie for tabs etc)
I have tried a few different things without success, sorry again if I missed something obvious :)
<div bind:display={from!(ui_state:active_tab|fmt.c("none"))}>"OTHER text"</div>
I am guessing that one does not work as `display' is not a component but a field of "Style"
So I also tried
<div bind:s:display={from!(ui_state:active_tab|fmt.c("none"))}>"OTHER text"</div>
and some things like
<div bind:s:background-color={from!(ui_state:active_tab|fmt.c("#9c27b0"))}>"BLA OTHER text"</div>
And various other things (with & without format , with String
fields to bind to etc),
without success.
this works one I can switch between flex & none, but is not bound to anything, obviously (code shortened), so nothing dynamic
let display_test = "none"; <div s:display={display_test}>"some text"</div>
Thanks in advance !
After #5 (and may be #1 ) will be implemented, it will be possible to select elements as entities using ess selector
and provide bindings for them:
// declaring eml scene
#[derive(Component)]
#[scene("path/to/scene.eml")]
pub struct ProfilePage {
#[source]
pub profile: Entity
#[select(.profile-avatar)]
pub avatar: Entity
#[select(.profile-name)]
pub name: Entity
#[select(.profile-health)]
pub health: Entity
}
// handle loading
impl SceneBind for ProfilePage {
fn bind(&mut self, this: Entity, commands: Commands, asset_server: AssetServer) {
commands.add(from!(this, Self:profile @ User:name) >> to!(self.name, Label:value));
commands.add(from!(this, Self:profile @ Health:current) >> to!(self.health, Range:value));
commands.add(from!(this, Self:profile @ Health:max) >> to!(self.health, Range:maximum));
}
}
Later we can all required information for instancing scene:
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let player = commands.spawn_empty().id();
let scene = asset_server.instance::<ProfilePage>(player);
commands.add(scene);
}
Hi, first thank you for your great work!
When I play with the img
widget, sometimes the image and it's content not presented, using inspector egui, I fount that the style.display
is Display::None
, but image already complete load.
belly/crates/belly_widgets/src/img.rs
Lines 24 to 25 in bf05d3b
app.add_system(load_img);
app.add_system(update_img_size.after(load_img));
I try to order these systems, and it fixed the issue, but I'm not sure it should ordered or not.
For now the only way to define is to use eml!
macro. It is possible to load simple eml assets without bindings.
The <slot>
tag will allow to fine-tune widgets. The idea is to create named slot inside the widget and redefine it content from outside:
// define some slots in the widget:
#[widget]
def alert(ctx: &mut ElementContext) {
let content = ctx.content();
ctx.render(eml! {
<popup>
<slot name="header">
// If no slot provided outide, the strong & br tag
// will render instead of slot
<strong>"Attention!"</strong>
<br/>
</slot>
<div>{content} </div>
</popup>
})
}
// redefine the content of slot later:
fn setup(mut commands: Commands) {
commands.add(eml! {
<alert>
// the text "Info" and <br/> will render instead of
// default slot content in the alert widget
<slot name="header">"Info:"<br/></slot>
"This is the alert with redefined `header` slot"
</alert>
})
}
Hi,
It would be more convenient to include a screenshot of each example in the same folder. This way users can see what to expect without compiling all the examples, taking into account that ther will be more exemples in the future (I've seen other crates doing this and find it very useful)
Current visible widgets use node-inside-node to achieve bordered panel look (button, ranges, text input).
The layout & styling will be easier to understand with panel
: bordered box.
Existed widgets should use this panel where possible.
This things would be nice to have:
Now, when we have Elements
SystemParam, it is pretty trivial to implement css-like selectors to iterate over matched entities:
fn cool_system(mut elements: Elements) {
// iterate over all entites with class background
// which is any-level-child of hovered button
for entity in elements.select("button:hover .backgronund") {
}
}
Tree-walk-lookup is ok at this stage. Tests would be really helpful. Later it is possible to index selectors or whole tree and have really cheap lookups.
This is required for #8
For now there is no sonsistent api for creating widgets. There is an idea:
Simple stateless widgets from func
#[widget]
fn div(mut ctx: ElementContext) {
ctx
.insert(ElementBundle::default())
.push_shildren(ctx.content());
}
Simple stateless widget with default styles:
#[widget(style="b { font: default-bold; }")
fn b(mut ctx: ElementContext) {
ctx
.insert(ElementBundle::default())
.push_children(ctx.content());
}
Statefull widget:
#[derive(Component)]
#[widget]
pub struct Link {
#[attribute(default = "empty".to_string())]
reference: String
}
impl Widget for Link {
fn default_styles() -> &'static str {
"Link { color: blue; }"
}
#[build]
fn build(&mut self, ctx: ElementContext) {
let entity = ctx.entity();
let content = ctx.content();
let reference = ctx.param::<String>("ref").unwrap_or_default();
ctx.render(!eml {
<span interactable on_press=emit!(Referenced, Link.reference)>
{content}
</span>
});
}
}
The skeleton is ready. Just remove quotes and add meaningful worlds.
I tried using a bevy handle for the image src however I get the error
error[E0277]: the trait bound `Variant: From<bevy::prelude::Handle<bevy::prelude::Image>>` is not satisfied
--> client/src/states/game/setup.rs:45:22
|
45 | <img src=crosshair_handle/>
| ^^^^^^^^^^^^^^^^ the trait `From<bevy::prelude::Handle<bevy::prelude::Image>>` is not implemented for `Variant`
|
= help: the following other types implement trait `From<T>`:
<Variant as From<&&str>>
<Variant as From<&str>>
<Variant as From<BtnMode>>
<Variant as From<ImgMode>>
<Variant as From<JustifyContent>>
<Variant as From<PropertyValue>>
<Variant as From<Val>>
<Variant as From<belly::belly_core::eml::Params>>
and 7 others
= note: required for `bevy::prelude::Handle<bevy::prelude::Image>` to implement `Into<Variant>`
this is the code:
let crosshair_handle: Handle<Image> = asset_server.load("crosshair.png");
commands.add(eml! {
<body s:padding="50px" s:position-type="absolute">
<img src=crosshair_handle/>
</body>
});
Based off of the example image-sources.rs i don't see anything im doing wrong. It's worth noting im on git instead of release so i realize that may be the issue. Im on git due to the alsa in the Cargo.toml not fixed in a release yet afaik. Any help would be appreciated. (Im aware i can just pass in a string and itll load the image however it seems to be inconsistent in my use case)
Hi, thank you for the hard work, this library is exactly what i was looking for.
I'm rendering moving objects to a texture and i want to display the my render inside the user interface.
Is it possible to passe a custume bevy image to the img component in stead of a file?
For now only simple binds are supported:
from!(player, Player:name) >> to!(name, Label:value)
The problem is if I create something like Profile
widget which displays player avatar/name/health based on provided Player
entity, it would be difficult to handle binds.
The idea is to respect the changeable page.player
entity in the single bind like this:
from!(page, Page:player @ Player.name) >> to!(name, Label:value)
from!(page, Page:player @ Health:current) >> to!(bar, Range:value)
from!(page, Page:player @ Health:max) >> to!(bar, Range:maximum)
This is how @
lookup selector is supposed to work:
Page.player
of the Entity
typePlayer.name
at Page.entity
to name, Label.value
(and others)Page.player
changes - clear existed binds from Page.player
and rebind them to new Page.player
source.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.