[Plugin] passC2Value

Post your completed addons to share with the community

Post » Mon Oct 31, 2011 12:14 am

Hi,

the plugin passC2Value allows you to pass a value from Construct to the parent html-site and vice versa. It's a little tricky and you should'nt be afraid of modifying html-code.

example
plugin

Example 2 - Calc with javascript with values from C2

Info: The plugin will not do anything in the preview, because in the local preview aren't any for the plugin needed variables - see below.

Have a look at the Html-Source of the example sites. After exporting your project in Construct2 you have to modify your index.html:

0) open your index.html with a text-editor (ie: notepad, notepad++)
1) copy the Html-Source from an example site and paste it in your index.html => save the file

if ('more than one passC2Value-Plugin used' or 'changed the initial values of the plugin')
   2) modify the variablenames as needed in the file index-html
(the variablenames are the initialvalues of the Plugin)

Have fun, Joe7 Joe72011-10-31 14:03:12
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sat Nov 05, 2011 6:55 am

Nice idea actually. I think in theory you could use this for say loading map data, etc.
Thanks.

Edit:
Seems you only have the initial name to call when reading. Might be nice if you could simply rename that or make up new ones at runtime.newt2011-11-05 07:27:38
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sat Nov 05, 2011 11:23 am

I think that loading map data is easier with javascript:

Call Google Map

Joe7
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sat Feb 22, 2014 5:48 pm

Hi, I want to use passC2Value to retrieve X and Y position coordinates of a sprite in Construct2, and populate fields on the container html with those values. However I don't know how to do that, can somebody please point me towards a good example? This is very important for my game project.
B
9
S
4
G
1
Posts: 18
Reputation: 1,315

Post » Sat Aug 22, 2015 10:44 am

Still any idea..?
B
9
S
4
G
1
Posts: 18
Reputation: 1,315


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest