Manual Entry for Functions?

Get help using Construct 2

Post » Fri Nov 09, 2012 9:28 am

I just got the new beta version :)

And I would like to know if there are any tutorials or a manual entry on the new functions plugin?

Else I would not know how to assign them
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Fri Nov 09, 2012 11:21 am

Manual entries are only updated on stable versions.

Here is a simple and useless example on how to use functions.

it is logically the same thing as functions in "regular" programming languages, you might want to look it up in another language to understand how/why to use it and pretty much how in C2.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Nov 09, 2012 11:24 am

They're not in the manual yet. You add them as a plug in on your layout. You can set them up in the event sheet as an event, and then add the actions you want them to perform. They can also be used as actions in the event sheet.
B
34
S
4
G
8
Posts: 67
Reputation: 5,857

Post » Fri Nov 09, 2012 12:33 pm

Yeah I know how they work in JavaScript.
I just was not sure how to create a function in Construct2.


@Kyatric
Thank you for the example.
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Fri Nov 09, 2012 6:40 pm

@Schoening

Mini tutorial:

1) Add a Function object to your project.

2) In your event sheet, add this event to create your function:
    Function: On "MyFunc"
    - Add your action/s (get parameter values with: Function.Param(n))

    Add a function call event e.g. System On start of layout
    - Add this action: Function: Call "MyFunc", with parameters as/if requiredVelojet2012-11-09 19:04:14
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Fri Nov 09, 2012 7:58 pm

Yeah so it basically is like a actual function.

A. Define.

B. Call
B
40
S
11
G
4
Posts: 665
Reputation: 8,403


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Artpunk, indiegrimes, NRABrazil, PixelatedTrip and 28 guests