Can I have a variable pointing to different arrays?

0 favourites
  • 5 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I have a menu with different Items that cycle left and right and wrap around. They get their names and info when to jump to the opposite side of the layout from an array with just one dimnension of 7 different strings.

    Now I would like to reuse the same set of actions for a second menu with a different item count and different names.

    Can I refer to the array in a way that allows me to change the reference when I trigger the menu?

    I hope this is somewhat clear and someone understands what I mean ;)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just duplicate the events and replace object with the other array, or use a new row/column of the same array

  • Yes, I’ll probably copy and edit everything.

    Thanks!

  • It is a possibility to have multiple instances of a single array object, which you will then be able to pick by comparing instance variables, nth instance, or uid. This may not suitable for all applications though.

  • Thank you, that's very interesting to know.

    In my case I was hoping to use the same set of actions based on two different arrays, (kind of like passing the array ) because the Array.width makes a difference.

    But multiple array instances might come in handy at some point...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)