ishmaelmoreno
That will be my goal. Thanks for the advice.
By the way, I just finished my controller. Thanks for the help.
Psychokiller1888
Just to let you know I figure it out.
Instead of this: airConsole.getNickname();
I have to put this: air_console.getNickname();
I don't know why but it works.
Thank you!
I will try this.
No problem. Thank you for all your help.
Do I have to send the Airconsole.Nickname from the screen to the controller?
I tried it but I'm not getting the value for nickname.
var nickname = airConsole.getNickname();
document.getElementById("Nickname").innerHTML = nickname;
Thank you! I will try my best.
So I have to put this inside the controller.html?
AirConsole.prototype.getNickname = function(device_id) {
if (device_id === undefined) {
device_id = this.device_id;
}
var device_data = this.devices[device_id];
if (device_data) {
return device_data.nickname || ("Guest " + device_id);
};
Yes! Exactly that!
Thank you! It works perfectly.
Now, i'm wondering how could I get the Device Nickname?
Thanks!
It works! Thanks!
But I'm trying to add a different background color for each controller and for that it does not work.
Is there a way to get the device_id?
How can I do that?
Where can I find the very simple and quick Javascript beginner guide?
Do I have to put the "if" condition inside the handshake.data?
How do I get the values from the browser?
Sorry I'm in a rush, just a few days left for submitting the game.
Thank You!
I'm trying to change the button image background. I was trying with this code but is not working.
Is this the right way to do it?
https://drive.google.com/file/d/0B2tJAThC4ueZeEl0aEY5OUQyT1E/view?usp=sharing
I'm reading the guide from https://developers.airconsole.com/#!/guides/construct2 and I don't see in the controller.html how to get the message from the screen. Or maybe I don't see it.
Can you please tell me what is the function or code on how to get the message from the screen.
Develop games in your browser. Powerful, performant & highly capable.
arod17pr Try this code : > // Rewritten version // By @mathias, @cheeaun and @jdalton (function (doc) { var addEvent = 'addEventListener', type = 'gesturestart', qsa = 'querySelectorAll', scales = [1, 1], meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; function fix() { meta.content = 'width=device-width,height=device-height,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; doc.removeEventListener(type, fix, true); } if ((meta = meta[meta.length - 1]) && addEvent in doc) { fix(); scales = [.25, 1.6]; doc[addEvent](type, fix, true); } } (document)); [/code:3ijd6inc] Put it before [code:3ijd6inc]instanceProto.onCreate = function () {[/code:3ijd6inc] If it doesn't work, try adding this code : [code:3ijd6inc] $(this.runtime.canvasdiv).width(window.screen.width/2); $(this.runtime.canvasdiv).height(window.screen.height/2); [/code:3ijd6inc] After [code:3ijd6inc]instanceProto.tick = function () {[/code:3ijd6inc]
arod17pr Try this code :
> // Rewritten version // By @mathias, @cheeaun and @jdalton (function (doc) { var addEvent = 'addEventListener', type = 'gesturestart', qsa = 'querySelectorAll', scales = [1, 1], meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; function fix() { meta.content = 'width=device-width,height=device-height,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; doc.removeEventListener(type, fix, true); } if ((meta = meta[meta.length - 1]) && addEvent in doc) { fix(); scales = [.25, 1.6]; doc[addEvent](type, fix, true); } } (document)); [/code:3ijd6inc] Put it before [code:3ijd6inc]instanceProto.onCreate = function () {[/code:3ijd6inc] If it doesn't work, try adding this code : [code:3ijd6inc] $(this.runtime.canvasdiv).width(window.screen.width/2); $(this.runtime.canvasdiv).height(window.screen.height/2); [/code:3ijd6inc] After [code:3ijd6inc]instanceProto.tick = function () {[/code:3ijd6inc]
X3M
I added them and still does not work. Am I the only one with the problem?
Thank you for the help!