Announcement

Collapse
No announcement yet.

Issues adding dynamically some button images into my UI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issues adding dynamically some button images into my UI

    Hello All,

    I'm here trying to dynamically add some button images into my UI.
    I'm creating and managing all this from my HUD class.I've tried to find clear solution for this process; I've found some implementations around but they are not working for me right now. I would appreciate to see official documentation about this process too.

    Here the project example --> https://github.com/carlesgutierrez/ButtonsGridExample
    Last edited by CarlesGutierrez; 04-18-2018, 03:24 AM.

    #2
    Your terminology is wrong, I can't understand what you are talking about. Your grammar needs improvement as well.

    Comment


      #3
      Thanks Dudester01, I could see that you lately are complaining in this forum. I'm quite new here and I would like to see people more about helping than complaining. Thanks any way for your criticisms. I will improve my terminology and spelling as well.

      Comment


        #4
        @CarlesGutierrez Not sure how bad your message was before editing but it's perfectly understandable now. @Dudester01 Shame on you ;p

        Let's see if I got it right. In order to dynamically spawn UMG buttons you will need to wrap each one in a separate widget.

        Create a new widget and put just a button in there, no canvas needed. You can add any other elements - text, borders, variables and so on. You will, most likely, want to tell the button what its function is, too. Here's how you can bind something dynamically to a button:

        Click image for larger version  Name:	Capture.PNG Views:	1 Size:	84.9 KB ID:	1463122
        You are free to add this button as a child to any container you desire, of course.
        Last edited by Everynone; 04-18-2018, 04:28 PM.

        Comment


          #5
          Hello @Everynone,

          Your example looks fast and handy, thanks for that.

          Yes, I want to do this but also use UniformGridPannel to set many buttons in it.You could see in the shared example I've tried to use more classes/UIWidgets separately to have a clearest BP structure.

          Finally I've found what did my error: I was using a variable as class ( purple BP class ) into my Create widget. "I do not why"... but setting it directly the class name worked properly. I would like to know what is going on here. Any idea?


          Click image for larger version  Name:	WorkingAddingButtonCapture.PNG Views:	2 Size:	89.1 KB ID:	1463420Working !

          Click image for larger version  Name:	image_135632.png Views:	1 Size:	99.2 KB ID:	1463421Not working!

          Thanks,
          Last edited by CarlesGutierrez; 04-19-2018, 03:50 PM.

          Comment


            #6
            Just bumping this, why one way works and not the other one. What's the difference?

            Comment


              #7
              Not sure. I've always thought you cannot dynamically spawn native classes with UMG at all. Right up until you said that it is 'Working!'

              Comment

              Working...
              X