Jump to content

Add metadata in GUI elements


Dad72
 Share

Recommended Posts

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? 

Link to comment
Share on other sites

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.  :)

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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 :D , however it sounds like you should just make a sword class/object, that has a sprite, a 3d model, and sword data.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...