0
\$\begingroup\$

I'm attempting to create a card game as a new Unreal Dev. Currently I have a UI for the board. That UI has children for the Hands, Field, and Card Details (A window to the side of the field that has a larger picture of the card and a written description). The Hands and Field have Cards created as children.

When I click any card, I want to populate the Card Details with the picture and description of the clicked card. How do I get it so that when a card anywhere is clicked, it updates the Details page?

So in a nutshell I want to get card info from:

UI > Hand/Field > Card 

to:

UI > Card Details
\$\endgroup\$
4
  • \$\begingroup\$ Are you asking in general how to pass data (read from clicked card to info field) or did you encounter an error while actually implementing something and you are stuck on a step? \$\endgroup\$
    – Zibelas
    Commented Jul 8, 2023 at 12:45
  • \$\begingroup\$ The first one. I don't know how to send the data from the specific card back to Card Details. I imagine I could send data from Card to Hand/Field to UI to Card Details. But that seems unnecessarily complex especially if I have to duplicate a lot of work between Hand/Field. I'm wondering if there is some way to do this more directly so that you can click on a card for details in multiple context without having to duplicate that work everywhere (hand, field, discard pile, deck, where ever else). Thanks \$\endgroup\$ Commented Jul 10, 2023 at 2:40
  • \$\begingroup\$ It depends how you store your card data. You could pass a whole card data object around (detail card would read the data it needs from it), field place would read other data it needs from it, the card data object contains all data a card has. Or you just pass a card id around and load the data you need from a local database \$\endgroup\$
    – Zibelas
    Commented Jul 10, 2023 at 7:04
  • \$\begingroup\$ Either would work for my purpose (I do have a database of card info). I just don't know what is the best method for passing this sort of data around. So is there some way to click on a card from any where (Hand, Field, Discard, Deck, Wherever else) and have my Card Details Widget consume the information about which card was clicked? Thank you \$\endgroup\$ Commented Jul 10, 2023 at 20:58

0

You must log in to answer this question.

Browse other questions tagged .