Author Topic: [RFC] WebPlay  (Read 5290 times)

pcercuei (OP)

  • Posts: 1689
    • My devblog
[RFC] WebPlay
« on: September 16, 2013, 11:18:25 am »
Hi guys,

Here's a small app I've been working on yesterday: a HTML5 game player.
It can launch local .html files of downloaded websites, but the point of it is for HTML5 games. I added [RFC] as I only tested it with a very small game, so I don't know how it performs.

If you want to test it, your game must handle keyboard keys (and no mouse), and render in 320x240. WebGL is not supported. Note that GameMaker can export to HTML5, so that means it should be somewhat capable of running games made with it (though a native port would be preferable).

Download it here: https://docs.google.com/file/d/0B9EgGumkJaabbjUxX0p0aEtVWXc/edit

ruffnutts

  • Posts: 2654
Re: [RFC] WebPlay
« Reply #1 on: September 16, 2013, 01:22:54 pm »
How cool thanks ;D

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [RFC] WebPlay
« Reply #2 on: September 16, 2013, 02:21:01 pm »
What a nice addition!
So, now can we make & run Construct 2 games?! :o

pcercuei (OP)

  • Posts: 1689
    • My devblog
Re: [RFC] WebPlay
« Reply #3 on: September 16, 2013, 03:22:08 pm »
I don't know, try it ;)

Shubshub

  • Posts: 9
Re: [RFC] WebPlay
« Reply #4 on: September 16, 2013, 10:53:23 pm »
Guys Just so you Know
WebPlay will only work Correctly on the Current latest firmware and Onwards as of this Post
Otherwise it won't be able to Read the Keypresses from the GCW Zero c:

Dexidus

  • Posts: 958
Re: [RFC] WebPlay
« Reply #5 on: September 06, 2015, 01:27:00 pm »
Any further development on this project? Very interesting! I'm working on a cool little platformed in construct2, but it won't run in webplay at all (I get an error alert, commented that out and tried again, but now it's just a black screen). I'll double check later if it's outputting webgl or something, doubt it tho. Any who, this project sounds super promising and opens the doors to a LOT more games for sure!

gameblabla

  • Posts: 1433
Re: [RFC] WebPlay
« Reply #6 on: September 06, 2015, 07:10:04 pm »
pcercuei has not released the source for this, which is a shame.
I hope he can change his mind, because i would like to see it running on other platforms too.

gameblabla

  • Posts: 1433
Re: [RFC] WebPlay
« Reply #7 on: September 06, 2015, 07:11:29 pm »
I'll double check later if it's outputting webgl or something, doubt it tho.
You should tell Construct 2 to use Canvases instead of WebGL for it to work.
If it does not support anything other than WebGL, well you're screwed.

EDIT: Crap, double post. Didn't realised.

pcercuei (OP)

  • Posts: 1689
    • My devblog
Re: [RFC] WebPlay
« Reply #8 on: October 01, 2015, 09:55:51 pm »
pcercuei has not released the source for this, which is a shame.

Code: [Select]
#include <QApplication>
#include <QUrl>
#include <QWebFrame>
#include <QWebView>

#include <iostream>

int main(int argc, char **argv)
{
if (argc < 2) {
std::cerr << "Please input URL as the last argument\n";
return 1;
}

QApplication app(argc, argv, QApplication::GuiServer);

QWebView view;
view.page()->mainFrame()->setScrollBarPolicy(
Qt::Vertical, Qt::ScrollBarAlwaysOff);
view.page()->mainFrame()->setScrollBarPolicy(
Qt::Horizontal, Qt::ScrollBarAlwaysOff);
view.resize(320, 240);
view.showFullScreen();

char *path = argv[argc - 1];
path = realpath(path, NULL);
if (path) {
view.load(QUrl::fromLocalFile(path));
free(path);
} else {
view.load(QUrl(argv[argc - 1]));
}

return app.exec();
}