farhan

Members
  • Content Count

    23
  • Joined

  • Last visited

About farhan

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. farhan

    HTML text input within Phaser canvas

    That is weird; when I set AUTO for Phaser CE 2.11.0, I believe it uses Canvas for the IOS devices because everything played at a slow framerate. It runs faster when I set to WEBGL. When I use 2.6.2, everything runs much faster and smoother/higher framer rate for the same device when set AUTO.
  2. Cool, that is exactly what I did to clean it, destroy the children. Sometimes it is faster to do it myself based on what I know than figuring out what Phaser already provided 😛 I am still new to Phaser, and don't have much time to figure out everything lol But thanks for the tips, will look into that as I work on more Phaser projects.
  3. farhan

    HTML text input within Phaser canvas

    Try Phaser 2.6.2 or someone needs to fix Phaser CE 2.11.0 so it will work with the phaser plugin-input
  4. farhan

    HTML text input within Phaser canvas

    https://github.com/orange-games/phaser-input Works great with Phaser 2.6.2 but does not work right with Phaser CE 2.11.0 I believe whatever updates added to 2.11.0 broke the phaser-input plugin. I wish Phaser CE 2.11.0 has backward compatibility. Speaking on Phaser CE 2.11.0 I found out that it defaulting the game to use Canvas instead of WebGL. Is there a reason to use Canvas as default? Having Canvas as default option is just a bad idea because Canvas sucks on mobile devices. Which is why I change to 2.6.2 which it uses WebGL as the default option PLUS phaser-input works
  5. farhan

    Why Phaser 3 Don't Allow Loading Data URI?

    Thanks for the tip. But I am not loading external assets but in the game code itself because I am making a project where I have to have all assets data in one index. Which is by using data URI not URL it is a base64 data. By using data URI you don't have to provide the image or audio or video files but the data of those files in strings. This is one of the sites I am using to convert images files into base64 data URI. https://www.base64-image.de/
  6. If you are talking about latest IOS, the only solution is to separate audio track from the video. Make sure the video has no audio track and then just play audio and video at the same time. And for checking on end video, use on audio end to continue because for some reason on IOS devices, it cannot detect when the video is over when the video has no audio track, at least the is an issue I encountered.
  7. Nope, IOS 8 and 9 are just too old. In addition, there is no way that I know of to get the hardware mute status on iPhone for html/canvas games unless you are making native apps/games. Perhaps Apple can answer this question BUT they have addressed this issue on newer devices/IOS. People who still uses IOS 8 and 9 have to live with it 😛 It is not the end of the world just because you cannot mute it using hardware mute. Right now, it is already at IOS 11 which works great, and in the next year or 2, IOS 8 and/or 9 will be gone by then. I can't wait 😛
  8. Thanks everyone for the info; yeah, i figured out that in default, it destroys group object which is why the group was null; when I set not to destroy, it works fine, but like you said this may cause garbage issue. We can also recreate all groups, but to me, that is pointless since why do we need to destroy and then recreate again, when we don't really need to destroy it in the first place. Anyway, I ended up not using the statemanager and just go back to the basic way where we set the preload, create, update and/or render functions when creating the game; and I just create my own simple state manager and clean up the group manually The only downside, all game states are clumped together, but at least it is simpler and I don't have to destroy and recreate unnecessary stuff I was just trying out statemanager so that I'm able to organize the code by states; but I guess this is not a good option for me. Specially when I am just making a tiny simple short game.
  9. farhan

    Looping background image?

    is there a reason why tiled images needs to be power of 2? while regular sprites can be in any size? is tiled sprites using a special feature that needs power of 2? if it is, then i guess i just have to make my own tiled sprites using regular sprites and manually move them etc etc
  10. Hi, I used the game states to add different states like preload, main menu, game and status screen etc and in the global variable, I have a group called container, and in Preloader I create or add the group; and for some reason when I try to access the group created by thePreloader from other states/classes, the game value of the group is null, and I cannot use that group unless I recreate it in the that state/class. Is there a way to create a global group that I can share with the rest of states? Can I define/add this group in other state and share with other states? Thanks. Global = { container:null, } Game.Preloader = function (game) { }; Game.Preloader.prototype = { preload: function () { }, create: function () { Global.container = this.add.group(); console.log(Global.container);// the game data is NOT null }, }; Game.MainMenu = function (game) { }; Game.MainMenu.prototype = { preload: function () { }, create: function () { console.log(Global.container);// the game data is null }, };
  11. farhan

    Why Phaser 3 Don't Allow Loading Data URI?

    In the main Phaser site they have a link to this site https://supernapie.com/blog/loading-assets-as-data-uri-in-phaser-3 I chatted to this person and they say the guide was made based on the project they did, and those are all the only information available for now. If someone else have tried loading other data uri like I mentioned above, it would be great if you can share
  12. I just started to play around with Phaser 3. One major thing, why Phaser 3 Don't Allow Loading Data URI? Phaser 2 works great with data URI but not Phaser 3. I found a guide for how to load data uri but there are bunch of missing stuff like how to load a atlas and json spritesheet or how to load sound without json, or how to load video? I wish Phaser 3 were like 2 which is seamless way to load data uri without needing to use hacky way to them. The best would be something like Phaser 2, just pass data uri instead of file path. This would be a great addition for Phaser 3. Not really an addition but re-add I hope there are tutorial in more detail on how to load data URIs.
  13. farhan

    Text input? (Text box/Input field), How?

    It is working on latest IOS devices but not android nor older ios like ios 8 or 9 for whatever reason. Update: It seems that it works great on Phaser 2.6.2, for some reason Phaser 2.11.0 doesn't work
  14. I tried to test on IOS 9 same issue happening. Perhaps this is old IOS issue.
  15. farhan

    Loading Video As Data URI?

    There is no error at all. Video just doesn't play at all. But, I finally manage to figure it out, had to change stuff in pixi.js There are 2 issues, first createSource the path is being changed to lowercase which breaks the data uri and second is the type where it did not get a proper data from the substr. Here are my current changes to createSource function, in addition, have to add a isDataURI flag all over to tell i am loading data uri. But I think I will change it to just check in this function if it has base64 in the string. function createSource(path, type, isDataURI) { if (!type) { if(isDataURI == undefined) isDataURI = false; if(isDataURI) { path = path.split('?').shift(); type = path.substr(path.indexOf('data:')+5, path.indexOf(';')-5); } else { path = path.split('?').shift().toLowerCase(); type = 'video/' + path.substr(path.lastIndexOf('.') + 1); } } var source = document.createElement('source'); source.src = path; source.type = type; return source; }