Which clone is clicked?


#1

For @oio,

I'm using the 'Speed property as an Index' hack having examined the Read Clone XY file shared previously. I have a rectangle and 2 clones of it that I want to attach (ie; position) text objects to. That is I want the text objects to use the x/y data of the clones for their position property's.

I copied the structure of the aforementioned file but am obviously missing something crucial as it is still not working. I can share a file for examination. Thx


#2

Ok, i think we can try doing this here. If it gets too complicated, i will give you an oio-games dotthingycomthingy addr.

Did you post your file?


#3

Trying to post the file now. Doesn't look like I can post direct to the forum? Will use Dropbox and share a link

Cheers


#4

Okay I'm a total dunce. Still figuring out how Hopscotch works :neutral_face:

Here's the link:
https://c.gethopscotch.com/p/xs2h22ws0


#5

It's okay. No need for dropbox, unless you mean you're putting the actual JSON file there. If you post it to the Hopscotch projects server, and assuming I know your Hopscotch user name, I can just go look you up and grab it...

Okay... Got it... Yep. It just sits there, kinda stuck. Now... let's talk about what you want it to do.


#6

Hi sorry for delay, Friday night and all that...thx for looking at it

I have the one box that is an emoji, then that has the text label WALK which takes the position of the box. When the box is tapped the character walks across the screen. I need three boxes total so figured I would try and be clever/efficient/lazy and clone two from the one all of which I was able to do, except now I need to find the position of the clones to pass the x/y data on to the other test labels (STOP, RUN)

I could very easily just create the other buttons from scratch but I see this challenge as an opportunity to try learn some new techniques

Don't sweat it if it can't be done

Cheers
Adam


#7

Ok, sure, we can do that with clones. Not the most efficient for only three buttons, but it scales better than making a bunch of base objects.


#8

Brilliant. Like You said, not the most efficient but I look at it as an opportunity to learn :grinning:


#9

I made this for you, Adam:

CLONE SELECTOR EXAMPLE


#10

Wow. Speechless. Works fantasticly well. I did not get a chance to dig around in the code yet but the user interaction is really slick and responsive. Thanks so much for helping. Massive help. :grinning::+1::grinning::+1:


#11

You are most welcome. Any time! You are a good papa to help your son with this stuff and with so much enthusiasm. Lucky kid... Never stop doing that.

And, by fhe way, thanks for the invite. I hadn't seen or even tried anything like this particular solution - honestly had little motovation to revisit the question. But you gave me a momentum transfer in that direction, a motivation to go discover something that I think might actually be better and more elegant than any approach I had seen or used before. So thank you @AdamMercado.

Not sure what string of emojis to end with, so... :sunglasses:

EDIT: This has given me a couple of game ideas. Maybe we can talk later... :slightly_smiling: