How do I set text system?

Get help using Construct 2

Post » Fri Jan 22, 2016 11:01 am

I would like to set some text in an object .

for exemple, put these letter to the object.
Image
Image

but when for exemple, A is on the first object on the top, if a click on B, this one should go under. I wanna make an order.
and when I take off the A, the B should go to the top and take his place. I would like to make it for 10-20 letters.
I know I should use array system but I still don't much understand how it works...
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Fri Jan 22, 2016 6:12 pm

You are going to have to track the content and UIDs of each sprite using instance variables and do a lot of comparisons on click.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Fri Jan 22, 2016 8:01 pm

gumshoe2029 wrote:You are going to have to track the content and UIDs of each sprite using instance variables and do a lot of comparisons on click.



I don't understand, how can I track the content and UID?
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Sat Jan 23, 2016 5:31 pm

can someone help me?
B
9
S
3
Posts: 56
Reputation: 1,003

Post » Sat Jan 30, 2016 5:11 pm

Hey, sorry for the late reply. I overloaded my feed and missed a bunch of replies.

You can either track by UID or by an instance variable that ties the text and sprite objects together. I think the instance variable would be easier for you.

You want to add an instance variable named "id" (or whatever) to both the Text and Sprite objects that you are using and add a number for each of them that correspond together, e.g. your 'C' Text would have an id=3 and your red box Sprite would have an id=3, while 'B' would be id=2 and your green box Sprite would be id=2, and your 'A' would be id=1 and your blue box Sprite would be id=1.

Then when the user clicks on the red box, you can check the id of the box that was clicked on versus the id of each text box and delete the corresponding text and then move the remaining sprites/text up.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: Elliott, kellehk, Voytek and 30 guests