Part 7: Setting Up a Grid repeater

Setting up my cards in a repeating grid pattern turned out to be a little trickier than I had expected. ย Hereโ€™s the steps I ended up needing to follow:

Create the Repeater component and map it to the Data array from my โ€œGet Card Definitionsโ€ data resource:

Screenshot 2023 11 11 at 14 14 52

Under Styles, you have to โ€œEnable Stylesโ€ and set the Direction to โ€œRowโ€, and under โ€œShow advanced layout optionsโ€ select “Wrap child elements to multiple linesโ€.

I also ensured that the width was 100% of the viewport (so that I can set smaller percentages for each card component that gets repeated):

Screenshot 2023 11 11 at 14 16 21

in my Card component, I want to make it Interaction: Click so that I can define an event handler for when the whole card gets clicked (which created my Deck Modification Event record). ย 

Screenshot 2023 11 11 at 14 17 14

In style for the card, I want the width to be 16.6% (roughly 1/6 of 100%) so that I can split the row into 6 tiles:

Screenshot 2023 11 11 at 14 18 16

Finally I could set up the Card Image component to retrieve the repeater itemโ€™s โ€œimageโ€ attributes:

Screenshot 2023 11 11 at 14 19 34

with a bit more styling of the card, this gets me something roughly what I was looking for:

Screenshot 2023 11 11 at 14 19 47 2x

This took AGES to work out, and I got some help from an ex colleague who has done quite a bit of UIB. ย Good outcome though!


Comments

One response to “Part 7: Setting Up a Grid repeater”

  1. August Dunnihoo Avatar
    August Dunnihoo

    This grid looks so sweet! It’ll be the playspace for my game which will make it a lot easier to use. At least I think.

Leave a Reply

Your email address will not be published. Required fields are marked *