Giter Club home page Giter Club logo

Comments (11)

setzer22 avatar setzer22 commented on July 23, 2024

I don't have time to add a bevy example right now 😅 but if anyone wants to contribute one, it's more than welcome!

In the meantime, perhaps you can share your attempt @trsh? I may be able to help, but I can't think of anything where bevy_egui would make things different than the official example.

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024
error[E0053]: method `value_widget` has an incompatible type for trait
  --> src\node_graph.rs:89:54
   |
89 |     fn value_widget(&mut self, param_name: &str, ui: &mut egui::Ui) -> Vec<MyResponse> {
   |                                                      ^^^^^^^^^^^^^
   |                                                      |
   |                                                      expected struct `egui::ui::Ui`, found struct `Ui`
   |                                                      help: change the parameter type to match the trait: `&mut egui::ui::Ui`
   |
   = note: expected fn pointer `fn(&mut MyValueType, &str, &mut egui::ui::Ui) -> std::vec::Vec<_>`
              found fn pointer `fn(&mut MyValueType, &str, &mut Ui) -> std::vec::Vec<_>`

I think it expects the Ui from eframe

from egui_node_graph.

Tsudico avatar Tsudico commented on July 23, 2024

I think you are missing a bit from line 89. It should look like:

     fn value_widget(&mut self, param_name: &str, ui: &mut egui::ui::Ui) -> Vec<MyResponse> {

Do you have a link to the project on github or a way we could see more details on what you are trying to do beyond the small error quoted?

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024
error[E0053]: method `value_widget` has an incompatible type for trait
  --> src\node_graph.rs:88:54
   |
88 |     fn value_widget(&mut self, param_name: &str, ui: &mut egui::ui::Ui) -> Vec<MyResponse> {
   |                                                      ^^^^^^^^^^^^^^^^^
   |                                                      |
   |                                                      expected struct `egui::ui::Ui`, found struct `Ui`
   |                                                      help: change the parameter type to match the trait: `&mut egui::ui::Ui`
   |
   = note: expected fn pointer `fn(&mut MyValueType, &str, &mut egui::ui::Ui) -> std::vec::Vec<_>`
              found fn pointer `fn(&mut MyValueType, &str, &mut Ui) -> std::vec::Vec<_>`

Imports

use egui::{self, DragValue, TextStyle};
use egui_node_graph::*;

I dont get it. I feed exactly the type it asks. I do not have a repo.

from egui_node_graph.

Tsudico avatar Tsudico commented on July 23, 2024

Bevy_egui uses it's own egui crate as seen in this example code:

use bevy::prelude::*;
use bevy_egui::{egui, EguiContext, EguiPlugin};

https://github.com/mvlabat/bevy_egui

Were you able to get a minimum bevy_egui example to run?

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024

Yes. It works. So maybe these egui versions are clashing?
beavy_egui has depency

egui = { version = "0.19.0", default-features = false, features = ["bytemuck"] }

So I think it just exposes it

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024

Tried to use like this

use bevy_egui::{
    egui::{self, DragValue, TextStyle},
    EguiContext, EguiPlugin,
};

and removed egui dep from my project. Same issue.

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024

egui_node_graph has "egui 0.18.1" depency, bevy_egui "egui 0.19.0". Thats what I see in cargo.lock

from egui_node_graph.

Tsudico avatar Tsudico commented on July 23, 2024

You can try getting a specific commit of egui_node_graph, like: b1deb59 so that they are both using egui 0.19.

You would have to update your egui_node_graph dependency in cargo.toml:

egui_node_graph= { git = "https://github.com/setzer22/egui_node_graph.git", rev = "b1deb59" }

from egui_node_graph.

trsh avatar trsh commented on July 23, 2024

Yeah. Already took latest from git and now it works. Different versions of egui was the issue

from egui_node_graph.

setzer22 avatar setzer22 commented on July 23, 2024

Glad you figured it out! 🎉 Ending up with different versions of a crate on the same project is always a headache

from egui_node_graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.