ogrotten

Members
  • Content Count

    10
  • Joined

  • Last visited

  1. I figured out the problem. The destination group pivot point was set to px 400,500. Then the incoming sprite had was also placed at 400,500. that means that the card was put at worldcoords of 800,1000. once I figured that out, the sprite appears where it needs to. Thanks for the replies.
  2. Based on the spriteinfo, the 'bounds' info is different whenever I click another card. When I click the faceup card on the 2nd stack, bounds changes to x:141.5 y:160 with W and H remaining unchanged. Is it possible that the rectangle that frames the card is moving around without the underlying spritesheet, or something like that?
  3. Thanks for responding. Here's the result That's the default 800x600 screen, and you can see which one I clicked. The shown coords where it says the sprite resides is just to the right of that lone card at the bottom. Would building a stage for it help contain things?
  4. I'm building a card game. 6 columns (phaser groups) of 5 cards. The goal is to click the card on top and move it to the discard group. Currently, when i click the card, it is apparently removed from rendering. Console shows visible = true, it's new parent group shows visible = true, coords are valid, and the console shows that the new group has it and the old group has removed it. I can move the clicked card on xy, no problem. But as soon as I try to add it to a group, it disappears. Here's the entire source on JS Fiddle. The callback function for the interaction is function tap() and lives at the bottom, of the source.
  5. My spritesheet seems to load fine, when I do game.add.sprite, it shows the first frame. Hooray. But how do i directly refer to specific frames of the spritesheet? It's a deck of playing cards. https://imgur.com/piX1ELd, and obviously it'd be best to be able to refer to cards directly. I load it with `GAME.load.spritesheet("cardsheet", "images/card_spritesheet.png", 154, 240, 65, 0, 0);` I'm assuming that it's going to find 5 rows, 13 columns in the mapped image Therefore, how would I refer to, for example, sprite 34 at row 3 col 8?
  6. Thanks for the reply. Excellent reference.
  7. I have a .png with a deck of playing cards on it. Unless I missed something, TexturePacker doesn't have a way to build a .json file from an existing sheet where elements have known dimensions. Therefore, is there an Pixi method to define sprite frames from an existing texture?
  8. ogrotten

    loading textures > sprites in a loop

    I'm not concerned about portability, either browser or OS. What's a manifest file (in relation to pixi)? Even if it knows there's, say, 30 files, and I load them individually in code doing something like var farTexture = PIXI.Texture.fromImage("resources/bg-far.png"); aSprite[1] = new PIXI.extras.TilingSprite(farTexture, 512, 256); 30 times, how does that take any less time than looping over the above until the 31st load fails? It's a synchronous load either way, is it not?
  9. ogrotten

    loading textures > sprites in a loop

    alright so I'll rephrase: Is there a known or best way to load textures in bulk? I've named my files numerically, and am reading them in a loop. I need it to stop trying when there are no more files... either by checking the file system for the next file, or even internally by checking the integrity of the most recently loaded file, or whatever other method there is. My assumption is that it's possible to load files flexibly for simple changing or expanding... Or. . . does pixi only expect a hard-wired file list, where it's directed to only and specifically certain files?
  10. How do I check if the next file exists or not? Deeper question: is there a 'best' or a known way to load a bunch of files/textures from a directory?