AD-Edge Posted September 25, 2013 Share Posted September 25, 2013 Hey guysNew to phaser and this forum, and Ive now run into my first issue! Tonight I've been working though the typescript 'getting started' page, setting up my phaser game-dev environment on Ubuntu 13.04. I have apache2, php and mysql working, with the default test page in /var/www running fine (basically have LAMP setup and running).I'm stuck however, trying to run the hellophaser demo. The canvas comes up as completely black, no logo or anything. Not sure whats gone wrong... Heres how it looks: If anyone has any suggestions, that would be great. I'll keep working at it, to see if I can find a solution. Also, absolutely loving Sublime2, today was my first time using it and I cant see myself going back to the text editors IDEs I have been using (unless I really have to for some feature or IDE that is). The mini-code scrollbar is amazing, as someone whos always getting lost in large scripts. -Alex Link to comment Share on other sites More sharing options...
Mike Posted September 25, 2013 Share Posted September 25, 2013 Hi, just because you share a screenshot and I don't see a developer tools opened - hit F12 and check for warnings and errors in the console - because the most logical problem is that something isn't loading. Link to comment Share on other sites More sharing options...
rich Posted September 25, 2013 Share Posted September 25, 2013 Definitely check the console, also try running something in the examples folder. Link to comment Share on other sites More sharing options...
rich Posted September 25, 2013 Share Posted September 25, 2013 Actually never mind - I can see the problem from the screen shot. You've opened the raw html file into Chrome as a file, maybe by dragging it into your browser window. You can't do it like that, Chrome doesn't have permissions to access your local file system (and nor should it ever have!) - you need to run a web server locally and serve the page to the browser. As you're on Ubuntu you've got this already, so try browsing to 'localhost' or similar, whatever your server is configured to serve on. Link to comment Share on other sites More sharing options...
AD-Edge Posted September 26, 2013 Author Share Posted September 26, 2013 Ahu! The chrome console printed out something helpful 'phaser-min.js:1Cross-origin image load denied by Cross-Origin Resource Sharing policy.' Which is, I believe, attributed to what youre saying Rich. I found a solution via google - starting chrome with the command 'google-chrome --allow-file-access-from-files' All is working now, cheers everyone. Link to comment Share on other sites More sharing options...
rich Posted September 26, 2013 Share Posted September 26, 2013 If you're running a local web server anyway then you don't need to do the --allow-file-access thing. You just have to request the page from the server, that's all. Link to comment Share on other sites More sharing options...
rich Posted September 26, 2013 Share Posted September 26, 2013 And PLEASE don't accidentally browse the web with -allow-file-access enabled!! Link to comment Share on other sites More sharing options...
AD-Edge Posted September 26, 2013 Author Share Posted September 26, 2013 Yeh I should have mentioned, somewhat opens things up to security risks... You just have to request the page from the server, that's all. How is this done? I'm not overly familiar with running code from a locally hosted server. Not using the -allow-file-access enabled command would certainly make life easier. Link to comment Share on other sites More sharing options...
rich Posted September 26, 2013 Share Posted September 26, 2013 It depends what address the server is set-up for. Try some of these in Chrome: http://127.0.0.1http://192.168.0.1http://localhost See what appears. Link to comment Share on other sites More sharing options...
AD-Edge Posted September 27, 2013 Author Share Posted September 27, 2013 Ahh, I see. Excellent http://localhost & http://127.0.0.1 both work as needed. Thanks for that -Alex Link to comment Share on other sites More sharing options...
Recommended Posts