Make Text String Object Follow An Active Object based on Object ID

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • So I'm working on this card game for fun, and I'm trying to make a card's properties show using Text Objects. I want it to sort of imitate the way Hearthstone looks. Each card has a unique ID, but I'm not sure how to make different text objects follow these cards based on this ID, since it seems these objects can't have any attributes.

    I can make a card's attribute show on screen fine, but I can't make this text be placed properly on the card, or make it move around with the card when dragged.

    Thanks in advance for any help! :)

  • This is the worst part about String Objects in my opinion. They can be singled out like most other objects, but there doesn't seem to be any reliable way of doing it. The string objects do have fixed values, but as you can only test it with "compare two general values", it can't be singled out that way. I think the only way is to test its coordinates or collisions.

    You can try something like this:
    + Is String overlapping Card?
    + Is card ID = selected ID
    - Set String.X to Card.X
    - Set String.Y to Card.Y

    However, that will break once the other string objects overlap the card. I guess you could make a special string object that appears only when a card is dragged. If you want text displayed on all the cards on the screen, you'll probably have to run a loop that destroys and re-creates the card- and string objects every time their positions change.

  • A simple solution would be to use the Active System Object instead of the String object. It works on all runtimes and supports fixed id and alterable values.

    If you insist on using string objects, you can take advantage of the Automatic pairing system in Fusion. Make sure there always is an equal ammount of String and Card. Then use this event:

    * Always
    - String: Set position to 0,0 of Card
    - String: Set alterable string to Property of Card.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!