-
Posts
432 -
Joined
-
Last visited
-
Days Won
4
jmp909 last won the day on February 6 2019
jmp909 had the most liked content!
Contact Methods
-
Twitter
jmp909
Recent Profile Visitors
3,316 profile views
jmp909's Achievements
-
microspace reacted to a post in a topic: Scaling a map without affecting the placement of a sprite
-
dude78 reacted to a post in a topic: Child sprite anchor - strange behaviour
-
eidosk reacted to a post in a topic: Masking a sprite with a complex shaped image
-
samme reacted to a post in a topic: Masking a sprite with a complex shaped image
-
DeadStar66 reacted to a post in a topic: Phaser Isometric - Move player to tile onclick?
-
jdnichollsc reacted to a post in a topic: Child sprite anchor - strange behaviour
-
indextwo reacted to a post in a topic: Tile Sprite
-
juandelossantos reacted to a post in a topic: animated tilemap
-
pyre reacted to a post in a topic: caching graphics to RenderTexture or BitmapData and adding to cache
-
chipnin reacted to a post in a topic: Add bitmapdata to cache as image
-
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 http://codepen.io/jmp909/pen/xZGVKy 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 http://codepen.io/jmp909/pen/adONdQ i guess it's a bug then
-
Cache should retain between states, that's what a preloader state is for!
-
i think i was having a similar issue here http://www.html5gamedevs.com/topic/18106-replace-image-atlas-in-cache-with-bitmapdata/ 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 http://phaser.io/docs/2.4.4/Phaser.BitmapData.html#generateTexture 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');
-
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 http://phaser.io/docs/2.4.4/Phaser.TilemapLayer.html#resize there's an example here http://phaser.io/examples/v2/tilemaps/resize-map 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.
-
i just meant a snippet of code you are using to make and store an image. eg I've done this before http://www.html5gamedevs.com/topic/5683-add-bitmapdata-to-cache-as-image/?p=99067
-
Phaser Multiple layers not rendering in screen with Tiled json map data
jmp909 replied to damiansito's topic in Phaser 2
you are given the option when you create a layer. also they have different icons -
Invalid layer ID given: null when creating a layer
jmp909 replied to Rchristiani's topic in Phaser 2
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 https://www.mvcodeclub.com/lessons/creating-enemies-and-collisions-in-phaser-and-tiled var walls = game.physics.p2.convertCollisionObjects(map, "Collisions", true); for(var wall in walls) { walls[wall].setCollisionGroup(wallsCG); walls[wall].collides(playerCG); } -
can you share your code or make a version on sandbox? i'm not sure if it'll all work just using preload state
-
Which proper way to use bitmap fonts and filters in Phaser
jmp909 replied to andrii.barvynko's topic in Phaser 2
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 https://www.google.com/fonts also you need to refer to which browsers support which font types http://caniuse.com/#feat=woff2 https://css-tricks.com/snippets/css/using-font-face/ for Android you'll likely need .ttf then -
set user scale to devicePixelRatio? I've not tried it but something like.. scale = window.devicePixelRatiothis.game.scale.scaleMode=Phaser.ScaleManager.USER_SCALEthis.game.scale.setUserScale(scale, scale)//this.game.scale.setGameSize(375*scale, 667*scale)there's some discussion here too i think http://www.html5gamedevs.com/topic/1380-how-to-scale-entire-game-up/
-
retina issue maybe?
-
I think mask may need to be of Phaser.Graphics type http://phaser.io/docs/2.4.4/Phaser.Group.html#mask try using alphaMask? Although I don't think that works on groups There's also this but it's old http://www.html5gamedevs.com/topic/1444-how-to-use-pixi-masking-in-phaser/
-
did you remove your FPS meter from the Android version? if not, try removing it and using bitmap text to display your fps http://phaser.io/sandbox/BGpUHRyb/play
-
Seems to be solved here... http://www.html5gamedevs.com/topic/11260-animations-wont-work-in-sprite-object/
-
here's one way to do it using Sin/Cos http://phaser.io/sandbox/gXbgAMnK/play and another using phaser's point rotation function (with a distance constraint... http://phaser.io/docs/2.4.4/Phaser.Point.html#rotate) http://phaser.io/sandbox/wDpGcNHm/play 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....