Dad72 Posted November 7, 2018 Share Posted November 7, 2018 Hello, I wanted to be able to add metadata in a GUI element as we can do with meshes. But that does not exist. I would like for example in my inventory, add a background image that corresponds to a 3D object, but the slot of the image contains information like the 3d object that corresponds to it and others that I want to add in a metadata. Would it be possible to add this in GUI? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 7, 2018 Share Posted November 7, 2018 Sure I'll add the property for next commit Dad72 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 7, 2018 Share Posted November 7, 2018 Hi guys... sorry to butt-in, but this idea seems... strange. Will a sprite have metadata someday? Will a lens flare? A material? Something feels strange about this idea. Yet I like it. Yet... I dunno. Metadata feels like it is crossing a boundary of some kind... but maybe that's just fine. :) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 7, 2018 Author Share Posted November 7, 2018 Imagine that in your game you have a sword to put in an inventory. In the inventory you display an image representing the sword. but if your player wants to use the sword in his inventory, we will not add him a picture in the hand, but a corresponding 3D object. In my case I will just record the name of the 3D object corresponding to the sword icon in its inventory so that when I select the icon in the inventory, a 3D object is displayed in the hand of the character. I can also add other info like the level, the damage that received the object and others ... Everything is contained in a GUI images. Do you understand Wingnut better ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 8, 2018 Share Posted November 8, 2018 Thx D and howdy. I understand the uses. I don't understand why you cannot add BABYLON.GUI.Control.metadata... for only YOUR project(s). Or you could add... BABYLON.GUI.Control.storage. Special-case GUI usage vs. everyone GUI usage. Will it be used often-enough by others, to warrant/justify global-core/for-everyone usage? (popularity) Perhaps no need to think about popularity, because it is such a low-memory-impact change. *shrug* ------------------ You COULD build a database-of-info in your scene. Then use the GUI Control's name... as a "look-up key" for a database record (which could contain lots of info). *shrug*. I'm easy. I would just like you and DK to consider this carefully... for wisdom/logic. Thx for the good usage example/comments. I like the idea. It just 'feels like' metadata should ONLY be available on sub-classes of Node. This will be the first time... metadata is used on non-node items, I think. Not sure. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 8, 2018 Author Share Posted November 8, 2018 I think this can be useful for many people the metadata in GUI to store and transfer data. As you say, this is not a major change that will have an impact on users or memory. I made this request for the sake of simplicity for me, but now that it exists, I'm sure others can find it useful on big projects. There is some demand that I made a long time ago when I read that it was not very useful and if we look today it is very use. Quote Link to comment Share on other sites More sharing options...
DylanD Posted November 8, 2018 Share Posted November 8, 2018 22 hours ago, Dad72 said: Imagine that in your game you have a sword to put in an inventory. In the inventory you display an image representing the sword. but if your player wants to use the sword in his inventory, we will not add him a picture in the hand, but a corresponding 3D object. In my case I will just record the name of the 3D object corresponding to the sword icon in its inventory so that when I select the icon in the inventory, a 3D object is displayed in the hand of the character. I can also add other info like the level, the damage that received the object and others ... Everything is contained in a GUI images. Do you understand Wingnut better ? Not sure i fully understand , however it sounds like you should just make a sword class/object, that has a sprite, a 3d model, and sword data. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 8, 2018 Author Share Posted November 8, 2018 Thank you Dylan. But the metadata now exists. I will try to explain better for you You have an inventory in which you storing objects in MMORPGs. The object is represented by an image.If we click on this image, I want to retrieve a 3D object, so my metadata is used to store more info corresponding to the image. In short, this subject is solved, the metadata have been added. I will not create a class by object because objects can be made. Have you ever played MMORPGs, you may understand better what I mean. Quote Link to comment Share on other sites More sharing options...
DylanD Posted November 8, 2018 Share Posted November 8, 2018 21 minutes ago, Dad72 said: Thank you Dylan. But the metadata now exists. I will try to explain better for you You have an inventory in which you storing objects in MMORPGs. The object is represented by an image.If we click on this image, I want to retrieve a 3D object, so my metadata is used to store more info corresponding to the image. In short, this subject is solved, the metadata have been added. I will not create a class by object because objects can be made. Have you ever played MMORPGs, you may understand better what I mean. Yes i have played an MMORPG, (runescape, elder scrolls online...) Im not sure i understand why we would use metadata instead of making a logical object or class. ? Is it just simpler? Is it more efficient? Good to hear its added already! edit: Oh actually i think i get it now. You want to click and retrieve the data from the gui.metadata which just has the location of the 3d model. So it just much more simple, and there is no need for the logical object or class... Right? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 8, 2018 Author Share Posted November 8, 2018 3 hours ago, DylanD said: Oh actually i think i get it now. You want to click and retrieve the data from the gui.metadata which just has the location of the 3d model. So it just much more simple, and there is no need for the logical object or class... Right? Yes it is exactly that, sorry for my bad english. It is easier to transmit the data or to recover them as well like this. DylanD 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.