Variable Definitions

Get help using Construct 2

Post » Thu Jul 18, 2013 10:41 pm

While I got the hang of some SC2 basics, I don't seem to be able to find some variable definitions by searching for them in the manual.

For example:

1) I was trying to understand the coding behind the Panning With Touch Controls example, which is pretty straightforward, but I could not find anything on the Touch.X("UI"). What is UI? Doesn't come up in the manual. I understand Touch.X, of course.

Second example:

2) This tutorial...

Smoke Trail Tutorial

refers to a lot of built in coding in SC2 itself (instance variables, indices...)

In trying to understand the code, I could not find anything on "parent" and I searched all instances of it in the manual. I sort of understand it, but it makes me wonder how many other things I don't know.

I would like to understand the code and what it's doing rather than just blindly copying people's examples every time I need something.

I did some programming in BASIC back in Commodore 64 days, but as a top level language I figure SC2 should not be that hard.

Where do I go to find out what's under the hood and how it works?

Does a tutorial have to exist to describe it?

Basically, rather than learning about everything piece by piece from other people's code, I'd like the whole breadth of it.
B
36
S
20
G
18
Posts: 244
Reputation: 12,863

Post » Thu Jul 18, 2013 10:44 pm

"Scroller" as in Scroller.Y would be another example from the Space Blaster demo.

Absolutely nothing comes up in the manual on keyword search.
B
36
S
20
G
18
Posts: 244
Reputation: 12,863

Post » Thu Jul 18, 2013 11:08 pm

If you don't understand what "parent" do in that "Smoke Trail Tutorial" you should really start here Beginner's guide to Construct 2
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Fri Jul 19, 2013 1:04 am

"UI" is the layer name.
[quote]
X("layer")
Y("layer")
XAt(index, "layer")
YAt(index, "layer")
XForID(id, "layer")
YForID(id, "layer")
Return the current position of a touch in layout co-ordinates, with scrolling, scaling and rotation taken in to account for the given layer. The layer can be identified either by a string of its name or its zero-based index (e.g. Touch.X(0)). The At expressions can return the position of any touch on a layer given its zero-based index, and the ForID expressions return the position of a touch with a specific ID.
[/quote]
https://www.scirra.com/manual/119/touch


'parent' in that example is an instance variable that has been added to the Particles object.
https://www.scirra.com/manual/73/instance-variables

And "Scroller" is a just the name of a sprite.ramones2013-07-19 01:04:58
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Fri Jul 19, 2013 3:59 am

Alright, guess I was having a brain fart.

(This explains all the bad vibes I was getting )

This is what happens when you post late and are exhausted.

But thanks. This makes it clear.

(I'm not a youngin btw, so things that seem obvious to people may not be so much for me.)

I was going through some other examples where people were doing things in a fancy way with function calls and what not and I thought this was referring to some built-in functionality I could not find anything about.

I still don't understand the purpose of the "scroller" sprite in the Space Blaster example and when you go to far up, the ship appears to jump down, but no biggie. I already set up custom boundaries.

I'm still having trouble with custom touch controls. It works the way I set it up, but sporadically for one of the boundaries.

I'll post an example in a bit for critique.

B
36
S
20
G
18
Posts: 244
Reputation: 12,863


Return to How do I....?

Who is online

Users browsing this forum: ASHKAR, Google [Bot], kellehk, R0J0hound, ST314 and 29 guests