hbkmad

Members
  • Content Count

    15
  • Joined

  • Last visited

  1. Ok so in the past it was simple. You just add "target-density=device-dpi" In your viewport meta tag and you are done. Images look as clear as possible. But 4.4+ Androids and iOS (I don't think they ever had this option) does not support this feature and => The images look blurry as f*ck and it's awful. How do you solve this problem? Any workarounds that you have tried and actually work? Thank you.
  2. hbkmad

    AJAX requests before loading images

    Thank you guys. I ended up sending them as parameters. Skeptron, how can I call the "Create" state manually and be sure that is not called automatically before the response have come?
  3. Hello, I'm making an AJAX request to a server to know exactly which images I have to load. But the problem is I want first the response to come and then to start loading whatever I need. Is there a way to make that without making the AJAX synchronous itself? Maybe if I make the request and call game.state.start("myscene") when the response have arrived but how would I be able to send the variables I need to this scene without making them global?
  4. hbkmad

    Phaser to .png

    Thank you very much for your help !
  5. hbkmad

    Phaser to .png

    My idea is to have a stage where it would be like a "Wardrobe" where the player would choose different clothes and etc. on his character and when he's ready the screenshot would be send to a server where it will be used later for an avatar of this account. How do you think it will be best way to send the information about the screenshot to the server via AJAX ? I mean what type of data should I send and then convert it on Server- side and save it there. Can I send Uint8Array ? Thank you very much once again.
  6. hbkmad

    Phaser to .png

    Thank you, the first topic helped me, I guess I'm using webGL. But now I have the data in Uint8Array how can I convert it to .png? Or is it better alternative to change my render to Canvas, how could I do that? Thank you again!
  7. hbkmad

    Phaser to .png

    Hello, I tried to make a screenshot of the game using game.canvas.toDataURL("image/png"); but the screenshot it returns me is a black one. Is there a property that I have to set before making the screenshot or something like that? Thanks.
  8. hbkmad

    Common Phaser + CocoonJS issues

    Hello, When I used Cocoon.App.openURL(..) It lost focus from the webview and phaser stoppend rendering the game. Is there a way to return the focus after the player closes the page? Because I tried clicking on the app but it didn't work it was just frozen. I used normal Webview. Thank you!
  9. hbkmad

    Problem with changing frames

    Hi, So I want to use a mute button to... wait for it... mute my music. Ok I've done that, but when the new level starts it generates new Mute button and the new Button is in default frame. I want it to change at the begining and go to the "mute" frame if the music was paused in previous states. Here is the code I can't understand why the frame option does not work. //preloadthis.load.audio('music', ['assets/audio/bckrg1.ogg', 'assets/audio/bckrg2.mp3']);//creategame.muteBtn = game.add.button(100, 0, "muteBtn", function (e) {if (e.frame === 0) { //I could use if music.isPlaying but the same logic goes with the framesconsole.log("muting");music.pause(); //music is local variable with the music of the gamee.frame = 1; //this works and change the frame of the button to the frame that shows muted button}else {console.log("unmuting");music.play();e.frame = 0; //this works and change the frame of the button to the frame that is unmuted button}}, this);if (!music.isPlaying) {game.muteBtn.frame = 1; //this does not work}
  10. Hi, I read somewhere that it's important to pay attention on the size of your images to be a degree of the 2 ( I really have no idea how this is said in English but I mean 4, 16 , 32 ...) And if for an example your image has 1025 width and height y it will take the same memory as an image with width 2048 and height y (or in other words the closest bigger degree of the 2) which of course is a huge memory loss. My question is: is the same for the spritesheets? Because if I have for an example 10 images with size 224x512 if I load them 1 by 1 I will lose 10x32 = 320 memory (because 256 - 224 = 32 ) but If I load them as a sprite sheet with size 2240x512 I will lose 4096-2240= 1856 memory. Now the plus of the spritesheet is that I will not use loadtexture to change the image but I will lose a lot more memory. For 1 sprite may seems ok but if they are a lot that's a problem. So is that true or the spritesheets load in different way?
  11. hbkmad

    Problem with npm install

    Thank you, that solved that problem but more came out. I'm copying the errors from the cmd: "gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable. gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod e_modules\node-gyp\lib\configure.js:103:14) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node -gyp\lib\configure.js:64:11 gyp ERR! stack at Object.oncomplete (evalmachine.<anonymous>:108:15) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu les\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Slavi\Desktop\webApp\github\mightyeditor\server\node_modul es\bcrypt gyp ERR! node -v v0.10.35 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok \" and after that there are more errors: " npm ERR! notsup Unsupported npm ERR! notsup Not compatible with your operating system or architecture: geoip @0.5.7 npm ERR! notsup Valid OS: linux,macos,darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64 npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! cwd C:\Users\Slavi\Desktop\webApp\github\mightyeditor\server npm ERR! node -v v0.10.35 npm ERR! npm -v 1.4.28 npm ERR! code EBADPLATFORM npm ERR! not ok code 0" I can't really understand the first one but the second one says that the windows is not supported? Do I have to install something else before trying to install the editor?
  12. hbkmad

    Problem with npm install

    Hi, I cloned the files, updated config-dev's host, then change my directory to server but when I run "npm install" it says "error: ENOENT, stat 'C:\Users\x\AppData\Roaming\npm' " Any ideas what might be the problem?
  13. hbkmad

    How to take user's input

    Hello, Is it possible to add in phaser a text field where the player would use the keyboard(mobile) to input text?
  14. Hi, I know it's probably not a phaser question but I'm new to web development and I want to know what are the good practices. I want in my game every user to have an account and when the game preloads to receive information from the server and when the user finishes playing to send data to the server that would be used when he plays the next time. (Like which level he played last time, I know this example is not good but let's say it's that) I don't want a code but information about what to use to make the accounts, log in when the game preloads and send the data. Cheers!
  15. Hello guys, I want to make a game and I'm looking for the technology I should use for it. I'm not only new to Phaser but to JavaScript, HTML and etc. as a whole and I'm sorry if the question sounds stupid but: In my game there will be a lot of audio so the game could become big only because of the audio. I want to separate it in different parts so when the player starts a new part the needed audio files (and maybe other files) would be downloaded so he can play this part and then after the player finishes the part it will be deleted and the new part will be downloaded and so on. (Also the part with the deletion is not necessary). Is that possible to be done with Phaser or with other framework? I just need some tips about how to do that so I would know it's possible. I want to use Phaser + PhoneGap to make the game. Cheers!