• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by jmp909

  1. try mySprite.baseTexture.skipRender=trueotherwise it uses the default texture for the sprite, which is generally the last texture used i think [update] actually that doesn't work ... skipRender here, just means both texture's dont show, presumably because they're actually sharing the same texture and just to confuse matters, this works now, but only because I've put 2 texture in the cache.. with 1 texture it breaks as you mention i guess it's a bug then
  2. Cache should retain between states, that's what a preloader state is for!
  3. i think i was having a similar issue here can you not have a prior game state that puts everything in the cache, and then load it in the next game state? also I don't know if this is any use to you generateTexture(key) → {PIXI.Texture}Creates a new Image element by converting this BitmapDatas canvas into a dataURL.The image is then stored in the image Cache using the key given. Finally a PIXI.Texture is created based on the image and returned.You can apply the texture to a sprite or any other supporting object by using either the key or the texture. First call generateTexture:var texture = bitmapdata.generateTexture('ball');Then you can either apply the texture to a sprite:game.add.sprite(0, 0, texture);or by using the string based key:game.add.sprite(0, 0, 'ball');
  4. are you trying to reveal more of the map but keep it at the same scale? you said "it does not show more map" so i assume so. you can use resize() i think but it says not to bind it to window resize event as it is expensive there's an example here resizeWorld makes the world the same size as the map, otherwise you'd only end up seeing eg one screen size of the map and it wouldn't scroll.
  5. i just meant a snippet of code you are using to make and store an image. eg I've done this before
  6. you are given the option when you create a layer. also they have different icons
  7. nope, you can't use createLayer on an Object layer, it's only for Tile layers if you're using p2 you can use convertCollisionObjects var walls = game.physics.p2.convertCollisionObjects(map, "Collisions", true); for(var wall in walls) { walls[wall].setCollisionGroup(wallsCG); walls[wall].collides(playerCG); }
  8. can you share your code or make a version on sandbox? i'm not sure if it'll all work just using preload state
  9. Google don't provide that web font, I don't know why you're trying to use it via that.. they only give the fonts available here also you need to refer to which browsers support which font types for Android you'll likely need .ttf then
  10. set user scale to devicePixelRatio? I've not tried it but something like.. scale =, scale)//*scale, 667*scale)there's some discussion here too i think
  11. jmp909

    mask doesn't work

    I think mask may need to be of Phaser.Graphics type try using alphaMask? Although I don't think that works on groups There's also this but it's old
  12. did you remove your FPS meter from the Android version? if not, try removing it and using bitmap text to display your fps
  13. Seems to be solved here...
  14. here's one way to do it using Sin/Cos and another using phaser's point rotation function (with a distance constraint... I've taken 0 angle as the top of the circle, but that's not the normal way angles are measured so i've shifted the value accordingly I'll leave you a challenge... add acceleration/deceleration to the movement....
  15. you could try this maybe this.initAnimations().bind(this)not sure if it's right
  16. you've not added a layer yet in your create function var layer1 = map.createLayer('Tile Layer 1')layer1.resizeWorld()
  17. yes text is already noted as expensive (slow) for the reason mentioned above
  18. my bad.. scaling doesn't quite come out how i'd intended can you create a webfont out of the littera font? then you could pull it in as live text, apply the filters and then cache the result as a bitmap (normal text is relatively slow, so not ideal for text that is present constantly) in your case though the double stroke is an issue as phaser won't support that directly... there are CSS tricks to do that but I'm not sure about the implementation note however you can use .generateTexture() to turn text into a bitmap texture ps i don't think filters work in Canvas mode, only WebGL mode. might need a different approach depending
  19. Have a language selector and only load/cache the images you need.... Regenerate if language is changed
  20. No, I mean is it eg a score where the digits update constantly or is it a static word? If the latter then create the whole thing as a dynamic bitmap at game startup time using those techniques, stick it in the cache and then pull it out of the cache as required
  21. When do you need to display the text and how often does it need to update?
  22. Probably wrong context for "this". Put ,this) At the end of your .add
  23. You could render your word to a texture/BitmapData, process pixels on the BitmapData to make a white silhouette of your word and scale it slightly bigger, then insert it behind the original word. Look here for how I made a sillhouette for the dropshadow I guess you could make a black copy and add the available blurX/blurY filters. Maybe there's an outline filter, but I haven't looked when I get back to my PC tomorrow I'll try and do an example
  24. Thats wrong this.selectorGroup.alpha = 0; that would just set the group alpha to 0, not the children's alpha either use setAll or forEach