Construct 2 games and projects in WordPress

Discussion and feedback on Construct 2

Post » Fri Mar 30, 2012 1:29 am

Hi everyone!

I've delayed far too long in posting this, but here it finally is. I've thrown together a Javascript-based form that helps you to port over exported Construct 2 projects to a WordPress plugin.

The form/tool is available from my Cloud9 IDE account as follows:
https://c9.io/ugotsta/tools/workspace/wordpress_construct2_plugin_maker.html

I've used it for quite some time in a number of ported projects, some of which are listed in the article, so I know it works well given my own circumstances.

There's a lot more still to consider though, so please feel free to add your thoughts if you have any. I'll be keeping an eye on this thread as well as the comments on that article (comments are done via Facebook to simplify login/validation).

I'd love to see this type of thing built into the export process, so if I can be of assistance to that effect, please do let me know!

3-30-2012 UPDATE: I've just updated the tool so it now asks for height and width and includes that in the output canvas. I couldn't easily regexp search the original c2runtime.js for height/width, especially since dimensions are per-layout, so I've just added it as a setting in the tool's page.

3-15-2013 UPDATE: Form now available from my Cloud9 IDE account, as the website's currently down. Incidentally, Cloud9 is blazingly faster than my previous host, so it's much quicker to use.

Cheers!
DavidMUgotsta2013-03-16 05:08:50
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Fri Mar 30, 2012 2:37 pm

You should definitely support different canvas sizes, it'll be difficult to use without!

I'm willing to add an Export for Wordpress option, but does it really need to change anything? Aren't you just running a C2 game in an iframe? You need to take off the page margin so it top-left aligns and that should be it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Fri Mar 30, 2012 3:37 pm

This is actually quite cool. What would be really awesome is if there was a wordpress plugin to just upload the game to a post. I could see a lot of people using that feature
B
69
S
11
G
6
Posts: 324
Reputation: 8,321

Post » Fri Mar 30, 2012 6:05 pm

Again Wordpress to come. And what about Joomla?

For Joomla would be ideal if we could have application in Yootheme ZOO, which is a catalog of games, which you can add games. Joomla community to reap even indifferent to the ZOO.

I am testing the ability to insert index file playing as a regular html code, but it certainly is not enough.DrNickTo2012-03-30 18:12:22
B
35
S
6
G
6
Posts: 37
Reputation: 5,382

Post » Fri Mar 30, 2012 7:53 pm

[QUOTE=mammoth] This is actually quite cool. What would be really awesome is if there was a wordpress plugin to just upload the game to a post. I could see a lot of people using that feature[/QUOTE]
Agreed. This is best handled from the WordPress side, as a WP plugin, rather than a C2 export option.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Fri Mar 30, 2012 10:52 pm

@Ashley, the tool doesn't actually wrap it in an iframe, instead it just adds the canvas element wherever WordPress detects occurrences of the shortcode. It also asks for the 'c2runtime.js' code and makes adjustments for the image and media urls. From there, you just copy/paste the adjusted code into a new .js file and include that in the plugin folder.

@mammoth, @Velojet, essentially that's what this particular tool does. It outputs a plugin. You just follow the instructions and you'll have your own plugin at the very end. It's just a matter of copy/paste.

This can definitely be much better done as an exporter for Construct 2 though. Construct 2 could very easily export a plugin, the same way this tool outputs a plugin. The only complication really, is with other than static height/width, full-screen apps, in other words.

As for a WordPress plugin that lets you upload your games, I think that could be done and I've considered that as well. It'd basically do what this tool does, but letting you upload the files, then it handles the slight conversion process internally, providing you with a shortcode on a per-upload basis. The upload process for this all is a bit of a beast though.

@DrNickTo, I've worked extensively with WordPress so I'm much more comfortable with integration with it. And I'm sorry to say, I really hate Joomla myself, I just think its interface is incredibly bulky and tough to work with. I very much love Drupal though and would love to tackle that integration. Perhaps someone else might be willing to delve into Joomla integration.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Fri Mar 30, 2012 11:16 pm

@Ashley, sorry I failed to fully answer your question with my response. This tool exports a legitimate WordPress plugin and it actually doesn't include the C2 exported .html or files other than the images and media.

It outputs it's own .php and .js files that work like the C2 exported files so that WordPress doesn't just link to that .html file for inclusion. It's basically a fuller integration than simply linking to the files.

It actually adjusts the image urls and the PHP portion echoes the plugin's url to the page so the adjusted Javascript file can access it. An exporter that does the same would just need to change the image and media urls likewise.

[EDIT: It would also need to include the PHP code. I'll gladly assist with that if this is all doable.]

It's my hope to advance this tool as well, so that it also includes an easy way to access WordPress' admin-ajax, for easy communication with the WordPress database. I need that for my own projects.

Also, if you're interested, the tool can easily be included here on the Scirra website, for reasons of speed, as my server's incredibly slow. It's just a Javascript file with some HTML form elements. I can email you that if you like.Ugotsta2012-03-31 00:06:37
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Sat Mar 31, 2012 2:50 am

I worked in Wordpress, and Joomla, and in Drupal. Everywhere there are advantages and disadvantages. Let us together attack the DLE. CMS - is another good way of evolution Construct 2, and you can not just dismiss this sector of the market due to personal preference. Somebody has to think about supporting other CMS besides Wordpress. But that's another topic for discussion.
B
35
S
6
G
6
Posts: 37
Reputation: 5,382

Post » Sat Mar 31, 2012 4:27 am

Sorry what I meant was upload it to your wordpress server.
B
69
S
11
G
6
Posts: 324
Reputation: 8,321

Post » Sat Mar 31, 2012 10:07 am

[QUOTE=Ugotsta]... This can definitely be much better done as an exporter for Construct 2 though. Construct 2 could very easily export a plugin, the same way this tool outputs a plugin ...[/QUOTE]
I'm afraid I can't see that myself. Since WordPress generates HTML pages and Construct 2 exports a HTML page, then surely it's better handled as a WordPress plugin that would attend to the details of integration. Any PHP coding, such as you mention, is definitely a job for a WordPress plugin rather than a Construct 2 exporter.Velojet2012-03-31 10:07:56
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Next

Return to Construct 2 General

Who is online

Users browsing this forum: elitezore and 17 guests