playMaker

Author Topic: Creating a Ui button for each item in an array  (Read 1285 times)

Pixel_Kat

  • Playmaker Newbie
  • *
  • Posts: 1
Creating a Ui button for each item in an array
« on: March 10, 2018, 04:53:44 PM »
Hi there!

Ive been looking for an action to dynamically create a U GUI button (with a vertical offset) as Im looping through an array of items. I know there’s a way to do it via code but I couldn’t find a way to do that with playmaker. Am I simply something obvious???

Thanks!
Kat

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Creating a Ui button for each item in an array
« Reply #1 on: March 11, 2018, 11:35:12 AM »
Hi.
You can parent the buttons inside a layout group.

Now to create the button, it is hard to set the onClick event.
So you can preset the buttons, or make 1 button and place a pointer event proxy.
and when you create a new button, rename the button.

then t know if a certain button is pressed you can use "Get Last Pointer Data Info"

here is a video about layout groups :