#bevy_cobweb_ui

1333 messages ยท Page 2 of 2 (latest)

twin quail
#

Ok thanks, could be a macos issue or something in my setup

twin quail
twin quail
steel tartan
#

Just updated the book

#

I am now starting the tab example.

steel tartan
#

Tired now I have uploaded my work so far

steel tartan
#

2025-01-24T00:53:23.987040Z WARN bevy_cobweb_ui::builtin::widgets:๐Ÿ”˜:widget: failed selecting radio button 33v1#4294967329; no RadioButtonManager found in ancestors 2025-01-24T00:53:27.466687Z WARN bevy_cobweb_ui::builtin::widgets:๐Ÿ”˜:widget: failed selecting radio button 35v1#4294967331; no RadioButtonManager found in ancestors

Should this say radioGroup?

twin quail
#

Oh yeah, will update it

steel tartan
#

I have published most of the tab tutorial now, I still need a second chapter to introduce macros and use defines.

I also need to adjust comment samples comments to highlight changes

twin quail
steel tartan
# twin quail Cool, I will do an editing pass once you've wrapped up the remaining things.

I have almost wrapped and I realised.




fn tab_change(trigger: Trigger<TabChange>, mut c: Commands, mut s: SceneBuilder) {
    if let Some(mut tab_commands) = c.get_entity(trigger.tab_content_entity) {
        tab_commands.despawn_descendants();
    };
    //Don' need this!
    c.ui_builder(trigger.tab_menu_entity)
        .react()
        .entity_event(trigger.button_entity, Select);

    c.ui_builder(trigger.tab_content_entity)
        .spawn_scene_simple(("main.cob", trigger.scene_name.clone()), &mut s);
}


#

I have published my progress so far but yeah I have added redundant code

#

I need to work backwords to remove redundant code

steel tartan
#

Well there is the commenting on sample COB code but you have added those on your last edits.

twin quail
steel tartan
#

Just added and removed some comment highlighting changes.
Once you have done your edit pass, you can rename tab title, remove WIP.

twin quail
#

@steel tartan ok editing done. You'll want to check the changes in the starting tab section of tab_cleanup. Much simplified.

steel tartan
#

Thanks checking it now,
Why did you add an rs on a cob file?

twin quail
steel tartan
#

It ended up hiding the #Scenes in the intro section so I removed it there

#

I don't know why it did it then and why it is not doing that now

twin quail
steel tartan
#

That change was needed to get #scenes to display properly

#

I don't understand why though

twin quail
steel tartan
#

Yeah, from memory it was rs, but I went back and saw it was rust
Guess we both know from now on.

#

I thought of using on_select right when I finished the whole thing lol

#

It does take a deceptively long time to write as every error I try and go back and edit it

#

Also probably should ask, do you care about colour vs color?
I find that the different spelling is good for variable names

twin quail
steel tartan
#

Will incorporate that change in my main program

#

Finished reading your changes thank you.

This is the best part of writing the book, is it gives me direct feedback!

#

The final code doesn't work it needs to be spawn_scene not spawn_scene_simple

#

I am guessing that is a typo as the prior code uses spawn_scene

twin quail
#

fixed

steel tartan
#

I think we can make a post in tutorials, what do you use to record your screen?

steel tartan
steel tartan
#

Tried OBS, and another program either too complicated or incompatible. cbf figuring it out

spare ruin
#

Hello, how can I add 2 buttons to a flexnode with different colors?

#
#scenes
"root"
    AbsoluteNode{width:100vw height:100vh justify_main:SpaceEvenly justify_cross:Center }
    BackgroundColor(#2C2F33)
    "button_board"
        AbsoluteGridNode{top: 45vh left: 37.5vw width: 25vw height: 45vh justify_cross: Center justify_main: Center}
        BackgroundColor(#2F4F2F)
        "button"
            FlexNode{width: 10vw height: 10vh justify_main: Center justify_cross: Center}
            BackgroundColor(#D2691E)

        "button"
            FlexNode{width: 10vw height: 10vh justify_main: Center justify_cross: Center}
            BackgroundColor(#00FF00)
        
#

I spawned it with commands.ui_root().spawn_scene(("mainmenu.cob", "root"), &mut scene_builder);

#

and it looks like this

#

altho I have 2 different Background colors for them

steel tartan
#

Does giving them different names help?

#

โ€œbutton1โ€ and โ€œbutton2โ€

spare ruin
#

Yes, thank you.

#

Is there a guidebook regarding the .cob files. I have 0 experience or any idea how to make even boxes inside boxes.

spare ruin
spare ruin
#

How can I solve this error?

2025-01-28T20:37:25.875704Z  WARN bevy_cobweb_ui::loading::cob::sections::cob_scenes: encountered scene item that isn't aligned with other items in the same layer at file: mainmenu.cob, line: 13, column: 17; item indent: 16, expected: 12
2025-01-28T20:37:25.876051Z  WARN bevy_cobweb_ui::loading::cob::sections::cob_scenes: encountered scene item that isn't aligned with other items in the same layer at file: mainmenu.cob, line: 16, column: 17; item indent: 16, expected: 12
2025-01-28T20:37:25.876359Z  WARN bevy_cobweb_ui::loading::cob::sections::cob_scenes: encountered scene item that isn't aligned with other items in the same layer at file: mainmenu.cob, line: 19, column: 17; item indent: 16, expected: 12```
spare ruin
#

I am trying to align 4 buttons in a small dashboard for my menu. Here is my cob file

#scenes
"root"
    AbsoluteNode{width: 100vw height: 100vh justify_main: SpaceEvenly justify_cross: Center }
    BackgroundColor(#2C2F33)
    "button_board"
        AbsoluteGridNode{top: 45vh left: 37.5vw width: 25vw height: 45vh justify_cross: Center justify_main: Center}
        BackgroundColor(#2F4F2F)
        "grid_node"
            GridNode{grid_auto_flow: Row row_gap: 8px grid_template_rows: [(Count(4) auto)]}
                "button"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#D2691E)
                "button2"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#00FF00)
                "button3"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#FFFF00)
                "button4"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#FFFFFF)
#

but the result is liek this. They are not centered

spare ruin
#

and is there a way to use a value as a percentage of their parent?

twin quail
# spare ruin I am trying to align 4 buttons in a small dashboard for my menu. Here is my cob ...

The warning comes from this

            GridNode{grid_auto_flow: Row row_gap: 8px grid_template_rows: [(Count(4) auto)]}
                "button"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#D2691E)
                "button2"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#00FF00)
                "button3"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#FFFF00)
                "button4"
                    FlexNode{width: 20vw height: 10vh}
                    BackgroundColor(#FFFFFF)

It should be

            GridNode{grid_auto_flow: Row row_gap: 8px grid_template_rows: [(Count(4) auto)]}
            "button"
                FlexNode{width: 20vw height: 10vh}
                BackgroundColor(#D2691E)
            "button2"
                FlexNode{width: 20vw height: 10vh}
                BackgroundColor(#00FF00)
            "button3"
                FlexNode{width: 20vw height: 10vh}
                BackgroundColor(#FFFF00)
            "button4"
                FlexNode{width: 20vw height: 10vh}
                BackgroundColor(#FFFFFF)
twin quail
#

Aside from that, I am no expert on grid layout so you might need to ask in #ui

#

Unfortunately the CSS layout stuff is a significant barrier to UI productivity for non-web-devs

steel tartan
#

% wont take into account row gap causing resizing (currently only a concern for height). You will have to add margins or use grid auto row.

Have you tried the using the justify center options on the grid node itself.

Justify only works on a level below

steel tartan
#

I am trying to use max_content in cob https://docs.rs/bevy_cobweb_ui/latest/bevy_cobweb_ui/ui_bevy/enum.GridVal.html .

but I am not sure how to translate to COB

my attempt

"build_datum"
    BuiltListUi
    GridNode{ grid_auto_flow:Column width:75%
        grid_template_columns:[auto] //Here have tried a few MaxConent, max_content maxcontent
        justify_cross:Center}

    "demolish"
        BackgroundColor($colours::demolish)
        "text"
            TextLine{text:"Demolish" size:15  font:{family:"Iceland"}}
            TextLineColor($colours::main_text)
    "building"
        TextLine{text:"Building name" font:{family:"Iceland"}}
        TextLineColor($colours::main_text)
    "count"
        TextLine{text:"districts" size:15  font:{family:"Iceland"}}
        TextLineColor($colours::main_text)
    "workers"
        TextLine{text:"workers" size:15  font:{family:"Iceland"}}
        TextLineColor($colours::main_text)
twin quail
steel tartan
#
serialization hint: GridNode{width:auto height:auto max_width:auto max_height:auto min_width:auto min_height:auto aspect_ratio:none border:{top:0px bottom:0px left:0px right:0px} top:auto bottom:auto left:auto right:auto clipping:None clip_margin:{visual_box:ContentBox margin:0} padding:{top:0px bottom:0px left:0px right:0px} justify_lines:FlexStart justify_main:FlexStart justify_cross:FlexStart column_gap:auto row_gap:auto grid_auto_flow:Row grid_auto_rows:[] grid_auto_columns:[] grid_template_rows:[] grid_template_columns:[] margin:{top:0px bottom:0px left:0px right:0px} justify_self_cross:Auto grid_row:{start:0 span:1 end:0} grid_column:{start:0 span:1 end:0}}
    at /home/lyndonm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_cobweb_ui-0.11.2/src/loading/extract/reflected_loadable.rs:53
#
#import
cs as colours
planet as planets

#scenes

"buildings"
    +planets::tab_title{
        FlexNode{padding:{left:10px right:10px}  justify_main:Center   }
        "text"
            TextLine{text:"Buildings" size:30 font:{family:"Iceland"}}

    }

"build_scene"
    FlexNode{width:100% flex_direction:Column justify_self_cross:FlexStart justify_main:FlexStart justify_cross:Center column_gap:5%
        margin:{bottom:10% top:5%}
    }
    "build_header_scene"
        FlexNode{margin:{bottom:5%} width:100% flex_direction:Row justify_main:Center }
        BackgroundColor($colours::outliner)
        "text"
            TextLine{text:"Buildings on planet" font:{family:"Iceland"}}
            TextLineColor($colours::main_text)

"build_datum"
    BuiltListUi
    GridNode{ grid_auto_flow:Column width:75%
        grid_template_columns:[MaxContent] // <--- Here
        justify_cross:Center}

    "demolish"
        BackgroundColor($colours::demolish)
        "text"
            TextLine{text:"Demolish" size:15  font:{family:"Iceland"}}
            TextLineColor($colours::main_text)
    "building"
        TextLine{text:"Building name" font:{family:"Iceland"}}
        TextLineColor($colours::main_text)
    "count"
        TextLine{text:"districts" size:15  font:{family:"Iceland"}}
        TextLineColor($colours::main_text)
    "workers"
        TextLine{text:"workers" size:15  font:{family:"Iceland"}}
        TextLineColor($colours::main_text)




twin quail
#

Can try (Count(1), MaxContent)

#

Might have a serde bug

steel tartan
twin quail
steel tartan
twin quail
steel tartan
#

Just looking at code here https://ukoehb.github.io/cobweb_book/tabs_cleanup.html

 "exit"
            FlexNode{justify_main:Center}
            RadioButton
            ControlRoot
            Multi<Animated<BackgroundColor>>[
                {
                    idle: Hsla{ hue:221 saturation:0.5 lightness:0.15 alpha:0.5 }
                    hover: Hsla{ hue:24 saturation:0.5 lightness:0.50 alpha:1.0 }
                }
                {
                    state: [Selected]
                    idle: Hsla{ hue:221 saturation:0.5 lightness:0.20 alpha:0.5 }
                }
            ]  
            Multi<Animated<NodeShadow>>[
                {
                    idle: {
                        color:Hsla{ hue:221 saturation:0.5 lightness:0.20 alpha:0.5 }
                        x_offset: 0px,
                        y_offset: 0px,
                        spread_radius: 1px,
                        blur_radius: 1px,
                    }
                }
                {
                    state: [Selected]
                    idle: {
                        color:Hsla{ hue:221 saturation:0.5 lightness:0.20 alpha:0.5 }
                        x_offset: 0px,
                        y_offset: 0px,
                        spread_radius: 10px,
                        blur_radius: 10px,
                    }
                }
            ]  

Is there a reason now shadow cannot be simplified to be like backgroundcolor?
Seems there is an extra object level

#

I don't know why I did it that way

twin quail
steel tartan
twin quail
#

Hey @ripe ice friendly poke for that animations tips and tricks :) if youโ€™re still up for it

ripe ice
twin quail
ripe ice
twin quail
# ripe ice Here's a quick draft, still working on it but lmk if you'd like me to talk about...

Saw your demo released, congrats! The trick you use for the menu opening transition where the camera seems to 'pan down' from looking at the sun is definitely cool and worth talking about.

In your draft I see you have pub fn item_box_hover_cosmetic<'a>(l: &mut LoadedScene<'a, UiBuilder<'a, Entity>>. Are you on an old version of cobweb ui? In latest you can just do pub fn item_box_hover_cosmetic(h: &mut UiSceneHandle.

ripe ice
ripe ice
candid fern
#

Hi all! I'm trying on adding nodes inside a scroll view at runtime, and I referred to the book and the examples here and here provided to do it. However, the nodes are appearing outside the scroll view and are stacked. Am I doing something wrong? Here is the code:

#scenes
"body"
    FlexNode{flex_direction:Column width:100% height:100%}

    "scroll"
        ScrollBase
        FlexNode{width:100% height:100%}
        BackgroundColor(#888888)

        "view"
            ScrollView
            FlexNode{width:100% height:30% clipping:ScrollYClipX}

            "foo"
                FlexNode{justify_cross:Center}
   "bar"
      ScrollBar{axis:Y}
      FlexNode{height:100% width:7px}
      BackgroundColor(#888888)

      "handle"
          ScrollHandle
          AbsoluteNode{width:100%}
          BackgroundColor(#BBBBBB)
fn foo(mut commands: Commands, mut s: SceneBuilder){
  commands
          .ui_root()
          .spawn_scene(("foo.cob", "body"), &mut s, |scene| {
              for i in (0..=20).into_iter() {
                  scene.edit("scroll::view::foo", |e| {
                      e.spawn(Text2d::new(format!("{} {}", "Foo", i)));
                  });
              }
          });
}
twin quail
#

And needs to have ScrollShim

candid fern
#

I thought that ScrollShim was no longer necessary after Bevy 0.15.1, as you mentioned in scroll example

twin quail
steel tartan
#

Hi its been a while, I want to change the background colour of the earth node to be say green, based on a condition.

Is there a way to use states for general logic as opposed to something like selected, or should I just spawn a different scene?

twin quail
steel tartan
#
    Multi<Animated<NodeShadow>>[
        {
            idle:{
                color:$colours::active_tab
                x_offset: 0px,
                y_offset: 0px,
                spread_radius: 1px,
                blur_radius: 1px,
            }

        }
        {
            state:[Selected] //Referring to this
            idle:{
                color:$colours::active_tab
                x_offset: 0px,
                y_offset: 0px,
                spread_radius: 10px,
                blur_radius: 10px,
            }
        }
    ]
``` instead of selected do I put `state:[Custom("colonised")]`
steel tartan
twin quail
twin quail
#

Ah not published yet

candid fern
twin quail
candid fern
# candid fern Hi all! I'm trying on adding nodes inside a scroll view at runtime, and I referr...

Here, I spawn text within ScrollShim. With these modifications here, it shows as expected within ScrollShim:

#scenes
"body"
    FlexNode{flex_direction:Column width:100% height:100%}

    "scroll"
        ScrollBase
        FlexNode{width:100% height:100%}
        BackgroundColor(#888888)

        "view"
            ScrollView
            FlexNode{width:100% height:30% clipping:ScrollYClipX}

            "foo"
                ScrollShim
                AbsoluteNode{width:100% justify_cross:FlexStart justify_main:FlexStart flex_direction:Column}
   ... # Same as before

"bar"
  "text"
    TextLine{text:""}
    TextLineColor(#ffffff)
fn foo(mut commands: Commands, mut s: SceneBuilder){
  commands
          .ui_root()
          .spawn_scene(("foo.cob", "body::"), &mut s, |scene| {
            scene.edit("scroll::view::foo", |scene| {
              for i in (0..=20).into_iter() {
                  scene.spawn_scene(("foo.cob", "bar"), |scene_handle| {
                            scene_handle
                                .get("text")
                                .update_text(format!("{} {}", "Foo", i));
                        });
              }
          });
}
#

The thing that seems strange to me, is that if I use spawn() instead of spawn_scene() to do it easier, the text keeps appearing outside, as if it does not follow the style

twin quail
candid fern
#

Right, I edited the code in the first message and forgot to put spawn.edit("scroll::view::foo"...) line ๐Ÿ˜…

twin quail
candid fern
#

I removed it for scene.spawn_scene(...) because when using scene.spawn(Text(...)), it appears like this (Text is in the bottom right):

candid fern
twin quail
candid fern
#

Idk, by now I have adapted to this and for what I want to do it might be the best thing, you can add this issue to the things to be fixed

candid fern
twin quail
short arrow
#

Hello,
In my game, I have two cameras:
The UI camera:

    commands.spawn((
        Name::new("UI Camera"),
        Camera2d,
        // Render all UI to this camera.
        IsDefaultUiCamera,
        RenderLayers::layer(UI_RENDER_LAYER),
        Camera {
            // Bump the order to render on top of the gameplay cam.
            order: 1,
            ..default()
        },
    ));

the 3D World camera:

    commands.spawn((
        Name::new("WorldModelCamera"),
        Camera3d::default(),
        Projection::from(PerspectiveProjection {
            fov: 90.0_f32.to_radians(),
            ..default()
        }),
    ));

How can I add RenderLayers::layer(UI_RENDER_LAYER), to all my UI nodes ?
My UI scenes are written in .cob

twin quail
#

The marker component can be registered for cob files with app.register_component_type::<YourMarker>().

short arrow
#

Thank you for your reply. I also thought about this solution, however, I'm not sure how you can traverse the UI hierarchy

twin quail
spare ruin
#

@twin quail Hello. Is there a way to see all the loadables? Im new and it is kind of confusing for me.

twin quail
spare ruin
#

Okay thanks. I will check it.

twin quail
#

I will add it to my todo list to be able to get the full list of registered loadables.

spare ruin
#

I want to make a simple menu with buttons but I dont know what loadable I need to use.

#

I tried GridNode and the blue boxes are the result.

#

The red outlines are what I want to do.

twin quail
# spare ruin
#scenes
"menu"
    FlexNode{width:100% height:100% flex_direction:Column justify_main:Center justify_cross:Center}

"button"
    FlexNode{margin:{top:10px}}
    BackgroundColor(#ABCDEF)

    "text"
        FlexNode{margin:{top:10px bottom:10px left:7px right:7px}
        TextLine

Then in-code spawn "menu" as a root scene, edit it and spawn each button separately as children of the "menu" node. Check the radio_buttons example: https://github.com/UkoeHB/bevy_cobweb_ui/tree/main/examples/radio_buttons

#

You'll also have the edit the button "text" nodes to set the text for each button.

#

The example shows how to do that.

twin quail
#

Branch bevyrc is updated to bevy v0.16.0-rc.5

twin quail
#

Published v0.12.3 to add the .cobweb file extension as an option if COBOL is causing conflicts in your environment.

steel tartan
#

Lol who is using cobol and rust

#

Not that it is a bad thing adding support just the scenario amuses me

twin quail
steel tartan
spare ruin
#

@twin quail Hi.

I did as you mentioned. The result is like this but how can I make all 4 of them automatically shrink or flex to have exactly 4 buttons with margins?

twin quail
spare ruin
#

When I try the example you mentinoed. The buttons are small.

spare ruin
twin quail
steel tartan
twin quail
spare ruin
#

@twin quail I managed to do it like this.


#defs
$buttoncolor = #ff0000
+mainmenubutton = \
    FlexNode{flex_grow: 1 margin:{top:5px bottom: 5px} width: 90% justify_main: Center justify_cross: Center}
\


#scenes
"mainmenu"
    AbsoluteNode{width: 100% height: 100%}
    BackgroundColor(#1e1e2e)

    "text"
        AbsoluteNode{top:40% left:45%}
        TextLine{text:"Simuverse"}

    "dashboard"
        FlexNode{left: 40% top: 55% width: 20% height: 40% flex_direction: Column justify_main: Center justify_cross: Center padding:{top: 5px bottom: 5px}}
        BackgroundColor(#2a2b3d)

        "play"
            +mainmenubutton{}
            BackgroundColor($buttoncolor)

            "text"
                FlexNode{margin: {top:10px bottom:10px left: 7px right: 7px}}
                TextLine{text:"BUTTON"}

        "play"
            +mainmenubutton{}
            BackgroundColor($buttoncolor)

            "text"
                FlexNode{margin: {top:10px bottom:10px left: 7px right: 7px}}
                TextLine{text:"BUTTON"}

        "options"
            +mainmenubutton{}
            BackgroundColor($buttoncolor)

            "text"
                FlexNode{margin: {top:10px bottom:10px left: 7px right: 7px}}
                TextLine{text:"BUTTON"}

        "quit"
            +mainmenubutton{}
            BackgroundColor($buttoncolor)

            "text"
                FlexNode{margin: {top:10px bottom:10px left: 7px right: 7px}}
                TextLine{text:"BUTTON"}
twin quail
#

Published bevy_cobweb v0.17 and bevy_cobweb_ui v0.13 with bevy 0.16 support.

steel tartan
#
    at /home/lyndonm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_cobweb_ui-0.12.3/src/loading/cob/data/cob_file.rs:56

   WARN bevy_cobweb_ui::loading::cob::cob: incomplete COB file parsing, error at file: ui/manifest.cobweb, line: 2, column: 1```

```rust
#manifest
"ui/colour_scheme.cobweb" as cs
"ui/buttons.cobweb" as btns
"ui/planets/planet.cobweb" as planet

#commands
RegisterFontFamilies[
    {
        family: "Iceland"
        fonts: [
            {
                path: "fonts/Iceland-Regular.ttf"
                width: Normal style: Normal weight: Normal
            }
        ]
    }
]

LoadFonts["Iceland"] // <-- required to actually use the font family! Also see LoadLocalizedFonts.

Is this a bug? I am still on 0.15 as not all my plugins have updated

#

Looked at latest code looks like that 0.13 will work but I am stuck on 0.12.

Is it easy to fix and publish, otherwise I can just rename in the interm

twin quail
steel tartan
spare ruin
#

@twin quail Hello, is it possible to register an enum component like the example below?

#[derive(Component, Debug, Clone, Copy, PartialEq, Reflect)]
pub enum MainmenuButtonAction {
    Singleplayer,
    Multiplayer,
    Options,
    Exit,
}

it gives out an error like this

    |                                          ^^^^^^^^ required by this bound in `CobLoadableRegistrationAppExt::register_component```
#
error[E0277]: the trait bound `MainmenuButtonAction: bevy_cobweb_ui::loading::Loadable` is not satisfied
   --> src\uimanager\mainmenu.rs:11:40
    |
11  |             .register_component_type::<MainmenuButtonAction>()
    |              -----------------------   ^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `MainmenuButtonAction`
    |              |
    |              required by a bound introduced by this call
    |
    = note: required for `MainmenuButtonAction` to implement `bevy_cobweb_ui::loading::Loadable```
spare ruin
twin quail
steel tartan
gritty ravine
#

Is there a way to deal with input fields in cobweb? I'm designing a chatbox ui but don't see that capability, do we need a separate crate?

twin quail
gritty ravine
#

Thank you very much for that info and I completely understand. I appreciate that, it puts me in the right direction, I didn't want to overlook something obvious in case I missed it ๐Ÿ™‚ I'll investigate for a while longer.

twin quail
gritty ravine
#

For doing that would I maybe add a marker component to the node I want to inject the text input field into and then query for that so I can set it as a child? I am a little unsure how to access the nodes hierarchy from the .cob structure.

twin quail
# gritty ravine For doing that would I maybe add a marker component to the node I want to inject...

There are two approaches:

  1. Access the cob structure directly and insert the text input to the appropriate node. No marker component required.
  2. Write a custom cob instruction that will auto-insert a text input to cob nodes.

For accessing nodes, check the repo examples: https://github.com/UkoeHB/bevy_cobweb_ui/blob/1a1208a41c3747f48a2278166dbe7c67b91fc9c7/examples/checkbox/src/main.rs#L10.
For writing instructions, see these docs (the Loadable values subsection): https://docs.rs/bevy_cobweb_ui/latest/bevy_cobweb_ui/loading/index.html#scenes-section.

gritty ravine
#

That worked perfectly and now I understand the api much better! I super appreciate the tips ๐Ÿ™‚

twin quail
#

Publishing v0.13.4 to fix a compile error on WASM. Note that CustomCursorUrl is broken until bevy v0.16.1.

twin quail
steel tartan
#

I think more of a rust problem, sorry going to be multiple posts due to charcter limit.

#
fn setup_panels(
    all_goods: Res<GoodsRepository>,
    mut commands: Commands,
    mut scene_loader: SceneBuilder,
) {
    //snip tracing
    let scene = SceneRef::new("ui/panels/political_panel.cobweb", "political_panel_scene");
    commands
        .ui_builder(UiRoot)
        .spawn_scene(scene, &mut scene_loader, |scene_handle| {
            let mut companies = scene_handle.get("menus::companies");
            companies.on_pressed(|mut commands: Commands, mut scene_builder: SceneBuilder| {
                let scene = SceneRef::new("ui/panels/political_panel.cobweb", "companies_popup");

                commands
                    .ui_root()
                    .spawn_scene(scene, &mut scene_builder, |scene_handle| {
                        let popup_entity = scene_handle.id();
                        scene_handle.update_on(
                            broadcast::<PrivateCompaniesUpdate>(),
                            move |id: TargetId,
                                  mut commands: Commands,
                                  scene_builder: SceneBuilder,
                                  companies: Res<CompanyRepository>| {
                                let private_company_popup = scene_handle;
                                for c in &companies {
                                    private_company_popup
                                        .spawn_scene(&mut scene_builder, |scene_handle| {});
                                }
                            },
                        );
                    });
            });
        });

//snip
#

I get a recursion error unless I uncomment out the for loop, I have no idea why?

#

Context is I am trying to fill in rows in the table

#

To be something like this

#
error[E0275]: overflow evaluating the requirement `&_: IntoIterator`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`pronytic_ui`)
  = note: required for `&bevy::prelude::Res<'_, _>` to implement `IntoIterator`
  = note: 126 redundant requirements hidden
  = note: required for `&Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, Res<'_, ...>>>>>>>>>>>>>>>>>>>>` to implement `IntoIterator`
  = note: the full name for the type has been written to '/home/lyndonm/Programming/pronytic/target/debug/deps/pronytic_ui-ea1ad4864b18c28c.long-type-17841256814943190798.txt'
  = note: consider using `--verbose` to print the full type name to the console

For more information about this error, try `rustc --explain E0275`.
error: could not compile `pronytic-ui` (lib) due to 1 previous error
twin quail
#

Presumably it's CompanyRepository(Vec<Company>) or something, and implements Deref?

steel tartan
#
   Compiling pronytic-ui v0.1.0 (/home/lyndonm/Programming/pronytic/pronytic-ui)
error[E0277]: the trait bound `bevy_cobweb_ui::loading::SceneRef: From<&mut bevy_cobweb_ui::loading::SceneBuilder<'_>>` is not satisfied
   --> pronytic-ui/src/panel.rs:137:54
    |
137 | ...                   .spawn_scene(&mut scene_builder, |scene_handle| {});
    |                        ----------- ^^^^^^^^^^^^^^^^^^ the trait `From<&mut bevy_cobweb_ui::loading::SceneBuilder<'_>>` is not implemented for `bevy_cobweb_ui::loading::SceneRef`
    |                        |
    |                        required by a bound introduced by this call
    |
    = help: the trait `From<&mut bevy_cobweb_ui::loading::SceneBuilder<'_>>` is not implemented for `bevy_cobweb_ui::loading::SceneRef`
            but trait `From<(_, _)>` is implemented for it
    = help: for that trait implementation, expected `(_, _)`, found `&mut bevy_cobweb_ui::loading::SceneBuilder<'_>`
    = note: required for `&mut bevy_cobweb_ui::loading::SceneBuilder<'_>` to implement `Into<bevy_cobweb_ui::loading::SceneRef>`
note: required by a bound in `SceneHandle::<'a, T>::spawn_scene`
   --> /home/lyndonm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_cobweb_ui-0.12.4/src/loading/scene/spawn_scene_ext.rs:297:52
    |
297 |     pub fn spawn_scene<C, R>(&mut self, path: impl Into<SceneRef>, callback: C) -> &mut Self
    |                                                    ^^^^^^^^^^^^^^ required by this bound in `SceneHandle::<'a, T>::spawn_scene`
#

sorry btree

#[derive(Default, Debug, Deref, DerefMut, Resource)]
pub struct CompanyRepository {
    pub map: BTreeMap<u16, Company>,
}
twin quail
twin quail
#

Or the TargetId. It's the same entity.

steel tartan
#

sorry got lost somewhere.

    commands
        .ui_builder(UiRoot)
        .spawn_scene(scene, &mut scene_loader, |scene_handle| {
            let mut companies = scene_handle.get("menus::companies");
            companies.on_pressed(|mut commands: Commands, mut scene_builder: SceneBuilder| {
                let scene = SceneRef::new("ui/panels/political_panel.cobweb", "companies_popup");

                commands
                    .ui_root()
                    .spawn_scene(scene, &mut scene_builder, |scene_handle| {
                        let popup_entity = scene_handle.id();
                        scene_handle.update_on(
                            broadcast::<PrivateCompaniesUpdate>(),
                            move |id: TargetId,
                                  mut commands: Commands,
                                  scene_builder: SceneBuilder,
                                  companies: Res<CompanyRepository>| {
                                for c in companies.iter() {
                                    commands.ui_builder(id).spawn_scene(
                                        (
                                            "ui/panels/political_panel.cobweb",
                                            "companies_datum_popup",
                                        ),
                                        &mut scene_builder,
                                        |scene_handle| {},
                                    );
                                }
                            },
                        );
                    });
            });
        });
#
warning: `pronytic-private-sector` (lib) generated 3 warnings
   Compiling pronytic-ui v0.1.0 (/home/lyndonm/Programming/pronytic/pronytic-ui)
error[E0599]: the method `spawn_scene` exists for struct `UiBuilder<'_, TargetId>`, but its trait bounds were not satisfied
   --> pronytic-ui/src/panel.rs:136:61
    |
136 | ...                   commands.ui_builder(id).spawn_scene(
    |                       ------------------------^^^^^^^^^^^ method cannot be called on `UiBuilder<'_, TargetId>` due to unsatisfied trait bounds
    |
   ::: /home/lyndonm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cob_sickle_ui_scaffold-0.6.0/src/ui_builder.rs:28:1
    |
28  | pub struct UiBuilder<'a, T>
    | --------------------------- doesn't satisfy `_: SceneNodeBuilder` or `_: SpawnSceneExt`
    |
    = note: the following trait bounds were not satisfied:
            `bevy_cobweb_ui::sickle::UiBuilder<'_, bevy_cobweb_ui::react_ext::TargetId>: SceneNodeBuilder`
            which is required by `bevy_cobweb_ui::sickle::UiBuilder<'_, bevy_cobweb_ui::react_ext::TargetId>: bevy_cobweb_ui::loading::SpawnSceneExt`
twin quail
steel tartan
#

Thanks a lot, I had no idea what was going on

#

And now I know what Id does

twin quail
#

Published v0.14.1 to fix a compile bug and add some internal optimizations.

twin quail
#

Published v0.14.2 to fix hot reloading causing nodes to disappear temporarily.
Published v0.14.3 with SetTextShadow loadable.

twin quail
#

Published v0.14.4 with a bugfix for windows.

steel tartan
#

Sorry whats the syntax for Vectors in cobweb files.

        TextShadow{
            offset:[5px 10px]
            color:#AA0000
        }

Tried a few variations all of them have failed

twin quail
#

And TextShadow isnโ€™t a loadable. Use SetTextShadow

steel tartan
subtle dome
steel tartan
subtle dome
spare ruin
#

Hello, is a dropdown selector possible with cobweb?

#

or a text input box.

twin quail
spare ruin
#

Im fairly new and I dont even know how to "integrate" it with a third party crate but I will look into it.

twin quail
spare ruin
#

is there an example within cobweb ui that I can study with?

twin quail
# spare ruin is there an example within cobweb ui that I can study with?

Not exactly, but bevy ui widgets are usually just spawning a node hierarchy as a child of an existing node, or adding funcationality to existing nodes. So with cobweb ui you can spawn a normal UI scene, then access the child node where you want your widget (the examples show how to do this), then spawn the widget (or insert its components) on that child.

Here are some text input crates:

steel tartan
#

I will add if you want more then one textbox at a time I would avoid simple text input as last time I tried editing one edited all

zealous meadow
#

If I'm super new to bevy do you recommend I use cobweb_ui or just use the existing bevy ui system?

steel tartan
zealous meadow
# steel tartan I think its as easy to start with, I would try out first few chapters in book ht...

I have a question
I want to display the players score using a .cob file, I have a Resource that records the players score, I'm not sure how to update a scene without simply spawning it again.

use bevy::prelude::*;
use bevy::time::*;
use bevy_cobweb_ui::prelude::*;
use std::time::Duration;

#[derive(Resource, Default)]
struct Score(u32);

pub struct UiPlugin;

impl Plugin for UiPlugin {
    fn build(&self, app: &mut App) {
        app.init_resource::<Score>();
        app.add_systems(OnEnter(LoadState::Done), setup_ui);
        app.add_systems(
            Update,
            update_ui.run_if(common_conditions::on_timer(Duration::from_millis(500))),
        );
        app.load("ui.cob");
    }
}

fn setup_ui(mut cmd: Commands, mut s: SceneBuilder, mut score: ResMut<Score>) {
    score.0 = 10;
    cmd.ui_root()
        .spawn_scene(("ui.cob", "main_scene"), &mut s, |scene_handle| {
            scene_handle.update_text(score.0.to_string());
        });
}

fn update_ui(mut score: ResMut<Score>) {
    score.0 += 1;
    // how do I update the "main_scene" in ui.cob?
    println!("{}", score.0);
}

Help is appreciated ๐Ÿ™‚

steel tartan
#

I can think of 2 options.

  1. Putting a component on each text and querying it like you woud on bevy.
  2. Adding reactivity via the bevy_cobweb (you are using bevy_coweb_ui crate.

I will am working on option 2 atm will post when I have it, shouldn't be too hard

steel tartan
# zealous meadow I have a question I want to display the players score using a .cob file, I have ...
use bevy::prelude::*;
use bevy::time::*;
use bevy_cobweb::prelude::*;
use bevy_cobweb_ui::prelude::*;
use std::time::Duration;

#[derive(Resource, Default)]
struct Score(u32);

pub struct UiPlugin;

pub struct ScoreUpdate;

impl Plugin for UiPlugin {
    fn build(&self, app: &mut App) {
        app.init_resource::<Score>();
        app.add_systems(OnEnter(LoadState::Done), setup_ui);
        app.add_systems(
            Update,
            update_ui.run_if(common_conditions::on_timer(Duration::from_millis(500))),
        );
        app.load("ui.cob");
    }
}

// fn main() {
//     App::new()
//         .add_plugins(DefaultPlugins)
//         .add_plugins(UiPlugin)
//         .run();
// }

fn setup_ui(mut cmd: Commands, mut s: SceneBuilder, mut score: ResMut<Score>) {
    score.0 = 10;
    cmd.ui_root()
        .spawn_scene(("ui.cob", "main_scene"), &mut s, |scene_handle| {
            scene_handle.update_on(
                broadcast::<ScoreUpdate>(),
                move |id: TargetId, mut editor: TextEditor, score: Res<Score>| {
                    write_text!(editor, *id, "{}", score.0);
                },
            );
            scene_handle.update_text(score.0.to_string());
        });
}

fn update_ui(mut score: ResMut<Score>, mut cmd: Commands) {
    score.0 += 1;

    

    // how do I update the "main_scene" in ui.cob?
cmd.react().broadcast(ScoreUpdate);
    println!("{}", score.0);
}

My ide was refusing to give me suggestions so that slowed me down, not 100% sure the syntax is correct but try this

#

remember to add bevy_cobweb

#

Basically whenever you update the score, you broadcast a signal to cobweb to update, the update_on after the text editor can contain any valid system parameters.

I am not 100% sure this is the best way will have to wait for Koe to confirm

zealous meadow
steel tartan
#

I should add an example like that to the book one day.

twin quail
#

Or you could broadcast a global event every tick, and update the score text on that event. Should be similar perf cost to running a system every tick.

steel tartan
twin quail
#

Published v0.15.0 which moves the cob definition to a separate crate cobweb_asset_format. The goal is to allow raw asset files to be parsable with the cob format without bevy_cobweb_ui as a dependency (I plan to replace TOML with raw cob in my game's server configs).

steel tartan
#

If itโ€™s raw is it still the cob format.

My understanding this is using bytes not text.

twin quail
steel tartan
#

Not sure if this is a cobweb thing, but when I changed text colour and hot reloadingI have noticed text disappering, resizing seems to fix.

twin quail
steel tartan
twin quail
steel tartan
#

for example it happens on "Dwarf Planets" but not "Pluto" or "Eris"

twin quail
#

The bug is caused by removing Node and its required components during a hot reload of a node. I fixed it for FlexNode but not for text stuff.

steel tartan
# twin quail Do Pluto and Eris have FlexNode?
    GridNode{ margin:{bottom:$row_gap}},
    "title"
        TextLine{text:"Dwarf Planets" font:{family:"Iceland"}}
        TextLineColor($colours::dwarf_title_text)

"dwarf_item_scene"
    FlexNode{
        margin:{left:20px}
    }
    TextLine{text:"dwarf" size:20.0 font:{family:"Iceland"}}
    TextLineColor($colours::dwarf_item_text)
    Multi<Animated<BackgroundColor>>[
        {
            state:[Custom("Colonised")]
            idle:$colours::colonised_outliner
        }
    ]

Yes it does, so would the grid node be causing this?

#

Pluto and Eris are instances of dwarf_item_scene

twin quail
steel tartan
#

I just used the example for scoreboard, I am getting denied permission

#

If this is intended I will fork and do the pull request thing tomorrow

twin quail
copper lichen
# twin quail You are trying to push main as a new branch, but main already exists.

hello, i wanted to ask how easy is it to do responsive ui in cobweb? i need something that i can use for applications, for example if screen width is less then 512px then different style should apply, usually in websites its bg-red md:bg-green so background is red by default but if screen reaches pre-defined medium-display size then background will be green

twin quail
# copper lichen hello, i wanted to ask how easy is it to do responsive ui in cobweb? i need some...

Hey, yes it's possible. Use something like:

"my_node"
    Multi<Static<Width>>[
        {value:200px}
        {state:[Custom("MediumDisplay")] value:150px}
    ]

Then either manually add/remove the "MediumDisplay" custom PseudoState from the node (see the PseudoStateParam system param), or add a marker component to all the nodes that should respond to display size changes and use a system to add/remove pseudostates automatically (this is what I plan to do for my project if I ever go mobile).

copper lichen
#

i will try it

twin quail
copper lichen
steel tartan
#

I learnt how to do ssh so I pushed the changes, (I forgot to commit them earlier lol).

looks like CI needs updating

#

I updated it to 24.04, now my new section of the book is live

twin quail
#

Just published v0.17.0 which adds TextShadowGroup and TextOutline loadables. The text outline impl is kind of brute force, so it may not be performant with large outline widths. But otherwise it gives quite nice outlines.

twin quail
#

Published v0.18.0 which adds simple anti-aliasing to TextOutline.

steel tartan
#

How would you load images in cobweb?
I am starting to replace text with icons!

steel tartan
#

Thanks, should have looked there, I thought it would be more akin to fonts

twin quail
#

Published v0.19.0 with default color for text outlines (black) and a perf improvement for text outlines.

twin quail
#

Published v0.20.0, which moves text outlines to the bevy_slow_text_outline crate and re-exports them. No changes are needed, but now outlines are capped at 8 pixels (after scaling).

twin quail
#

Published v0.21.0, which moves the core loading functionality to a sub-crate bevy_cobweb_ui_core. The sub-crate can be used directly if you want to load COB files without all the extra UI stuff (e.g. for just commands, or for non-bevy_ui scenes).

steel tartan
#

Is there a cobweb specific way to load ui near the mouse or should I just ask in the ui channel?

twin quail
steel tartan
steel tartan
#
  let window = r!(window_query.single());

  let cursor = r!(window.cursor_position());

    commands.ui_builder(UiRoot).spawn_scene(
        (file, "planet_orders"),
        &mut scene_builder,
        |loaded_scene| {
            loaded_scene.style_inplace(|ui| {
                ui.left(Val::Px(cursor.x));
                ui.top(Val::Px(cursor.y));
            });

Looked into it and turns out sickle does make it easier

steel tartan
#

Are radiogroup global?
I am having a problem when I click homstead in the top left, it also selects Homestead without deselecting urban.

If I click info it will deselect homestead.

The controlroot that holds Info, Buildings and census is a sibling of the desingation tab window

#

Sorry i mean radiogroup not control group

twin quail
steel tartan
#

Both children "Urban" and "Homestead" have RadioButtonHandlers the parent header has a RadioButtonManager.

This seems identical to my other set of working tabs. I am stumped, I think I will have to patch cobweb and start debugging from there.

steel tartan
#

Found the problem


                    scene_handle.on_select(move |mut commands: Commands| {
                        let mut tabs = commands.ui_builder(tabs_section_entity);

                        let desc = description.clone();

                        tabs.insert(Name::new("tab_section"));

                        tabs.update_text(desc);
                    });
                    if idx == 0 {
                        scene_handle
                            .entity_commands()
                            .add_pseudo_state(PseudoState::Selected);
                    }
                });
#
                    if idx == 0 {
                        let entity = scene_handle.id();
                        scene_handle.react().entity_event(entity, Select);
                    }

Should start with select this way

steel tartan
#

It's happening again ๐Ÿ˜”

scene_handle.edit("grid::categories::headers",|scene_handle|{

   let all_tab = scene_handle.spawn_scene((file,"tab"), |scene_handle|{
      scene_handle.get("text").update_text("All");
   });

   all_tab.on_select(||{
      info!("selected");
   });

   all_tab.on_deselect(||{
      info!("deselect"); 
   });


   let entity = all_tab.id();
   scene_handle.spawn_scene((file,"tab"), |scene_handle|{
      scene_handle.get("text").update_text("test");
   });



   scene_handle.commands().react().entity_event(entity, Select);

   
});

I do get the logged message of select and when I click it seems to work.

#

I buried it deeper and it's working thank you rubberduck

scene_handle.edit("grid::categories::headers",|scene_handle|{

   let all_tab = scene_handle.spawn_scene((file,"tab"), |scene_handle|{
      scene_handle.get("text").update_text("All");
      let entity = scene_handle.id();
      scene_handle.commands().react().entity_event(entity,Select);
   });

   all_tab.on_select(||{
      info!("selected");
   });

   all_tab.on_deselect(||{
      info!("deselect"); 
   });


   let entity = all_tab.id();
   scene_handle.spawn_scene((file,"tab"), |scene_handle|{
      scene_handle.get("text").update_text("test");
   });



   scene_handle.commands().react().entity_event(entity,Select);

   
});
#

I am guessing just the display of text wasn't propogated down

steel tartan
#

I have looked at doing the migrations.

bevy_cobweb has some changes to deal with the fact some systems now do results, I am not sure how you would like to handle it.

bevy_cobweb_ui looks like it's only breaking in that it doesn't have lerp, ctrl f on docs did not return any results for lerp

#

Oh lerp doesn't seem to have anything to do with 0.17

twin quail
#

Main problem I expect will be UiTransform/UiGlobalTransform.

#

I will try to get to updates this week/weekend.

steel tartan
#

Thank you, no hurry on my account at least, other plugins will be slower to update anyway.

I just looked to see if I could trivally help

#

Oh also if you are able to I would like if this was able to print the actual entity.

It's been in my code for 6 months but had no perfomance issues

#
   WARN bevy_cobweb::react::utils: more than 50 reactors were registered targeting an entity, which may impact performance; consider using a resource for 'reaction hubs' instead; this warning only prints once
    at /home/lyndonm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_cobweb-0.17.2/src/react/utils.rs:67
steel tartan
#

I had a second look at migrating cobweb_ui (only for a hacky 0.17 no new features) and unfortunately I ran into a serious case of skill issue.

I see that you no longer plan on supporting your Bevy libraries end of the year, which is all good and understandable.
I am grateful that cobweb was around I would still stick with it over BSN ๐Ÿ™‚ .
My plan is move to 0.17 and use the BSN fork.

Are there still plans to migrate to 0.17 or should I start migrating my UI to plain Bevy?

twin quail
steel tartan
twin quail
steel tartan
#

Are you still using bevy?

twin quail
twin quail
steel tartan
twin quail
twin quail
#

Hey all, not planning to update this crate to bevy 0.18 since it's past the end of 2025 (at the beginning of the year I said no guarantees past end of year). If anyone is interested in becoming maintainer, send me a message or just fork it :).

steel tartan
#

Understandable, are you planning to update the readme to say no update is planned?

#

Also thanks for getting it to 0.17.

Being able to use some 0.17 widgets while migrating away has made my life easier.

twin quail
steel tartan
# twin quail How has the migration gone?

I have only started with buttons two days ago.

I am having trouble understanding why the activate event is not triggering but it's easy to work around.
#ui message

I have also started making a compatibility layer for converting triggers to broadcasts, until I update the update_on method, for all uses.

/// Converts observer to broadcast, this is to maintain compatability with bevy_cobweb until it is removed
fn production_refresh_broadcast(_: On<ProductionRefresh>, mut commands: Commands) {
    commands.react().broadcast(ProductionRefresh);
}

I think radio buttons will be the more challenging migration.

I plan on sticking with 0.17 at least until I have done a few more pop up menus that I currently have planned, being able to paste from my existing solutions and check it is working is too useful to let it go.
I don't think 0.18 has anything I feel I need to get straight away, I was awaiting for 0.17 for UiGlobalTransform and that turned out to not be suitable for me.

I also got caught out by justify_main and justify_cross not being a thing in bevy_ui.

The biggest problem I was having with cobweb is that when your closures get too deep rust formatter breaks, I was going to work around it by turning them into top level functions, which the migration is forcing me to do anyway.

I have found that I am using a lot more marker components

This question here is as a result of my issues with marker components for UI but solution is good enough
#ecs message

I had hoped to go straight to BSN but I think doing bevy_cobweb straight to BSN had a good chance of breaking stuff.

All in all not painful, cobweb's iteration speed has already served it's purpose so fixing the colours now is not that big of a deal.

#

Also nodeshadow being a different name but I learnt how to read cobwebs documentation and figured it out without much issue

twin quail
steel tartan
#

In regards to my attempts to update myself, the trickiest things I found.

  • I have never used Serde, I have watched a video explaining it but not needed it before.
  • My favoured parser is lalrpop, which is quite different from Nom, as it's not a parser combinator
  • Macros, I have never really needed them except for one occasion, I am comfortable with Regex so I don't think the syntax is in my way.
  • The bevy stuff you use is beyond my needs, I have never needed unsafe.

I could overcome one of those at a time, but to overcome all of them at the same time for an existing project is too much for me.

#

Also reflect, I have only ever really derived it never used it.

#

If I wanted something like cobweb in future I think I would be better starting from scratch to use bevy's built in widgets rather then sickles

#

Also I have created my games data based very heavily on cobwebs syntax, I hope you see the similarities ๐Ÿ™‚

twin quail
# steel tartan In regards to my attempts to update myself, the trickiest things I found. - I ...

Honestly all the macros could be deleted/replaced, they are not essential. The serde/nom stuff is all stable/mature and shouldn't need touching (unless you want to add something like function callbacks, then it requires expertise). There is only one unsafe in cobweb_ui and it's buried deep, and one other deep in bevy_cobweb.

There's a little reflect between cob files and rust but not a ton (the ReflectedLoadable internal type) (an editor would require a lot more).

All the widgets are custom-built, nothing from sickle_ui is used (aside from pieces of the responsiveness/animation framework). I'd expect bevy widgets to be compatible with cobweb widgets, since it's all bevy_ui.

steel tartan
twin quail
#

But yeah, all that is just me defending the big project that I'm proud of :). Realistically, with BSN and editor supposedly on the (distant) horizon, as time passes it will become increasingly obsolete.

twin quail
steel tartan
#

Building from scratch would be not be me thinking the project isn't good enough ๐Ÿ™‚ just I would need to do it to get the requisite knowledge.

twin quail
#

The sickle macro. That bit in the editor directory is editor nonsense - heavy on reflect but not needed by the library (the editor is just a demo and is separate).

steel tartan
#

Are you going to migrate to another framework?

twin quail
#

I'm moving on from Bevy to do other things. Much more into building libraries than writing games, as it happens.

Currently a little obsessed with Leek Wars, then on to employment (probably crypto stuff again).

steel tartan
#

I am opposite I like building for the user rather then other devs, I feel I can reason about needs much better.

I looked at other hot reloading and they are CSS based as I see it, none them quite have that self contained logic I like about cobweb.

twin quail
#

I don't understand web dev or web devs. It all looks so ugly and opaque...

steel tartan
#

I like that I can see my main menu button, and reason about it, other then maybe one or two macros

twin quail
#

No way haha, don't curse me

twin quail
#

A couple weeks ago he said he likes using messages (events). Ah he's growing, I thought lol

steel tartan
# twin quail My little brother (11) is like that, he has the right instinct/drive for game de...

Nice, I am not sure I have right instinct for games.

But for a previous job, I see users use an ordering system and got to the same 3 menus for checking one item and go why don't we make a menu for that case.

Or when they key in doors, they select glass design then get asked if they need bushfire resistance (Australia) a menu will say sorry this glass design is not bushfire resistant , I would change it so we ask about bushfire resistance first.

steel tartan
#

Actually that was run system cached

twin quail
#

They are very convenient, until they spiral into a confusing mess lol

steel tartan
#

Also he is fortunate to be able to start young, I didn't know what programming was until I turned 17 and had no one to ask.

twin quail
#

Yeah I didn't really learn much until age ~24, decided to teach myself C++.

twin quail
#

I liked it well enough :) but now I've done Rust for three years and see C++'s weaknesses.

steel tartan
#

Finally moved away from cobweb_ui buttons.

I did some other stuff but the migration did take a while.

I plan on removing all my cobweb broadcasts.

I will still use cobweb as I want to create something like this before migrating to 0.18.

It's an upgrade on the construction blueprints on the side, as it's very information deficient

#

TODO list.

  • Convert broadcasts to observers, basically how my panels are update.
    I will skip the radiobuttons for now
  • Convert the radio buttons.
  • Create that construction outliner blueprints.
  • Create anything else before I pull the trigger and go to 0.18, probably plenty of time for other dependencies to update.
#

Thought I would update you since you asked ๐Ÿ™‚

#

OH typing to you gave me another idea, I am going to change the tab headings to be a list of checkboxes that will be used to filter

#

Thanks for being a rubber ducky

steel tartan
#

Finally moved all my cobweb logic away.

Still have bevy_cobweb_ui, not prepared to move away fully.

I will stick to plan of trying to create every UI I can think of in cobweb.

Now that I have switched, I think cobweb was not the right way of sorting my program.

  • I often display similar information in different places, I prioritise having the information you care about close at hand, means you can do one query and update text in multiple places.
  • Marker components and observers involve less nesting and closures, I have been soured on closures by it's poor support for cargo fmt and type inference (Not cobwebs fault!).
  • I should have done cobweb updates more at parent level to avoid having multiple redundant lookups, and shared workload.
#

But being on cobweb means the Bevy event/messages name changes didn't impact mes as much

steel tartan
#

Finally migrated away, going to move to 0.18 now

#

About 3 months of work!