Integrating GameSalad HTLM5 export.
adriangomez
Member, PRO Posts: 440
Let me know what you want to see. If I have time even if am not able to do it, I'll give it a try. Fill free to re-use for any purpose anything I post in this thread.
Comments
Something suggested by @uptimistik to me a while back was the idea of embedding a server with the app so you can do some code via network behaviors. And lo and behold: https://www.npmjs.com/package/nodejs-mobile-cordova
Theoretically, with Cordova we should be able to access the camera and other native features, correct? Would be awesome!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
3. Connecting to PlayFab. Using IDFV and retrieving user data.
Something wrong with the link, I hope you don't mind me posting a working one:
https://adriangomez.net/2020/04/12/gamesalad-gamefab-part-1/
@Braydon_SFX the main problem with the camera is registering the asset with the engine. The best bet would be to have a placeholder "camera" image. Then have the JS code drop the camera image into that same spot.
The next problem is triggering the camera, since we have to use existing behaviors. My suggestion there would be something like have the Tweet Sheet behavior trigger on a special tag like msg, something you are sure users won't tweet.
5. Leaderboards with PlayFab and easier integration.
8.App notification using OneSignal and Playfab.
The is also a video of it working:
https://youtu.be/OQqTalXDF-I
and all the work is now up on GitHub:
https://github.com/agramonte/GameSalad-Integrations
Anyone tried this?
I started to explore this option, but I have to say it's a bit over my skill level. I'm happy to share my findings and most humbly receive any tips and tricks you might have. 😊
Thanks @adriangomez great stuff! With your instructions I managed to use Cordova plugins with my gs game.
How have you handled aspect ratios? I get those ugly black letter boxes for iPhone versions.
I am using @bob loblaw 's great instructions for universal build https://youtu.be/fDDzy4A5NMA and it works great on gs with stretch. But when publishing html5 there is no "stretch" option.
Answering to myself, just in case someone else is struggling with this at some point.
Changing viewport-fit from "letterbox" to "fill" in cordova-app.js will stretch the app.
engine.setOptions({
'viewport-reference': 'window',
'viewport-fit': 'fill'
});
For some reason this universal build's https://youtu.be/fDDzy4A5NMA camsize / offset tricks don't work here. Investigation continues ...
not my video but his instruction is very similar to what i put in my template a while back.
sorry my bad, I must have mixed names at some point :)
Found the problem. GS's html5 export can't access Devices.Screen.Size.Height value. It returns project's originally selected platform's height, not the device's hight. Question to @adent42 : as Cordova compatible shouldn't Devices.Screen.Size.Height value return the device's height?
Answering to myself, just in case someone else is struggling with this at some point.
Workaround for this:
gse.Game.externalWriteGameAttribute('game.attributes.id924861', window.screen.width);
gse.Game.externalWriteGameAttribute('game.attributes.id732438', window.screen.height);
Then use the Height and Width attributes in GS instead of Devices.Screen.Size.Height and .Width.
Great find @muusi. I will use it in my project.
Great find with the work around. In theory you should be able to run it with game.devices.screen.width or whatever the correct path is and have it work. I'll put a note to look into it for the cordova js file.
Anyone else having problems with the Cordova iOS 6.0.0 release? After updating to this version html5 game's images don't load anymore. Any solution to this?
Just removing Cordova platform and plugins and installing them again does the trick.
@adent42 In the game projects package contents object.xml one can find the ids of global attributes. How about actor's private attributes, are the ids of those attributes to be found somewhere?