Hello si i’m new in babylon.js and i made this , but i need to add a GUI who can change the color of the mesh i click on, car someone write the code to add or directly add-it thanks.
(sorry i’m french)
Welcome aboard!
Click on the sphere to change it’s color. This is just one of the possible solutions.
I recommend you to read the docs to learn the basics:
https://doc.babylonjs.com/journey
Hello and welcome
I would advice you to give a try, and if you have some troubles we will help debug with pleasure.
But just asking the community to code something for you is not the good way to learn
Also, FYI you don’t need to create the engine, bind the canvas, or whatever.
All the basic engine and canvas setup is already ready in the Playground.
All you need is to define the createScene
function
Here is your playground fixed with the above consideration :
++
Tricotou
Thanks a lot for the help i wasn’t expecting a so fast responding
Hi and welcome to the Community,
You better get accustomed to it … but then, not all too much either
I suppose that means you want an interface. A visual interface. Like clicking on a button.
It’s no secret that I’m advocating for the inbuilt 'BJS GUI 'and its side tools such as the ‘GUI Editor’.
There’s a lot you can do using the 2D and 3D GUIs from babylon. Fully integrated in the scene.
I’d recommend you start to learn about it and ‘lucky you ’ there’s some very comprehensive doc with lots of examples breaking down the entire ‘thingy’.
What I would recommend, beeing new to the framework, is that you’d start split your time between ‘learning’ (outside of your project) and next ‘implement’ your new learning in your project. Step-by-step.
Haha. Fair enough asking. I also had a request along these lines: “Can you build me an awesome game for free and I would just soak it up without any effort” . I’m still waiting for the reply on this though
So, this is not an incitement to have others build your project… I rather hope that this small PG below will motivate you to learn more (and enjoy your learning) for making the most awesome UI and user experience using the Babylon.js GUI
As said, there are many ways and this one’s probably not the best. It is however simple and explicit enough (to hopefully have you wanting to do more and … better ) and has the advantage that I had most of it at hand, incidentally, from a project I’m working on. I just took a few minute to ‘vulgarizing’ it so to make it easier to understand (hopefully did succeed in this … else, let me know )
Right-click to select mesh. Left-click on button to apply.
Edit:
You don’t have to be sorry for that. Some of the people who answered (incl. me) are also FR. And so is our head of Well, me, just nearly, I’m CH. But when it comes to ‘bad or approximate english’, I suppose we’re all more or less on the same line