How do I make a position assigned to a single variable ?

Get help using Construct 2

Post » Thu Feb 12, 2015 11:33 pm

Hello,

In Unity C# we can use Vector 2 and 3 to set varibles that contain more than 1 value. A great example is if you want one variable to hold an RGBA color value. You would set the Vector4 to:
Code: Select all
myColorVariable = New Vector4(000,000,fff,fff);


This is extremely helpful when drawing boxes or setting something's position... (just use a Vector2(X,Y) for the X and Y value.)

What I am wondering is if we have something like this in Construct2?
How would I set a single varialbe to an objects X and Y position?

I can see we have something to set and return RGB values. This is why I am asking.

Thanks in advance for any help.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Fri Feb 13, 2015 1:51 am

No you'd have to simulate something yourself using arrays and maybe wrapping it in a function but I'm not sure it would be worth the trouble.
Last edited by codah on Fri Feb 13, 2015 11:46 pm, edited 1 time in total.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Fri Feb 13, 2015 6:05 am

Thank you codah :)
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Fri Feb 13, 2015 10:13 pm

I really wish C2 had these :P
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,465

Post » Fri Feb 13, 2015 10:54 pm

sqiddster wrote:I really wish C2 had these :P


Do you think someone could do it with a plugin? I wonder if HTML5 uses them?
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Fri Feb 13, 2015 11:41 pm

Nah, it's definitely a limitation of the editor. I don't even know if js supports them.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,465

Post » Sat Feb 14, 2015 1:20 pm

There's a way you can do it, actually. With weird integer encoding. >.> Let me see if I can't whip up an example.
Last edited by Unnatural20 on Sat Feb 14, 2015 1:54 pm, edited 1 time in total.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Sat Feb 14, 2015 1:49 pm

you can do it with arrays setting different arrays to different RGB codes then just load that
ImageImage
B
56
S
15
G
64
Posts: 1,259
Reputation: 39,696

Post » Sat Feb 14, 2015 3:41 pm

sqiddster wrote:Nah, it's definitely a limitation of the editor. I don't even know if js supports them.


Was looking into this further and JavaScript does not even have an integer. It just rounds float values. I have a feeling vectors where something extra special that they added to Unity or Mono.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940


Next

Return to How do I....?

Who is online

Users browsing this forum: increase, Mik07, Yahoo [Bot] and 1 guest