Enigmafan

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Enigmafan

    Tiling sprites

    Hello, another question... Suppose I have a game of chess. What would I use to render the playing board? I was thinking one could take 2 graphics, a white square and a black square and use them to build the 8x8 board. Would I use tiling sprites for this? Or is there something else you would use? I was thinking of sometimes changing the playing board. Can I erase the contents of a container? Do I need to 'destroy' the tiling sprites used before? Thanx in advance for your answers.
  2. Enigmafan

    Pixi text

    Thanx everyone for your replies. I went for the bmGlyph option :-)
  3. Enigmafan

    Pixi text

    Hi all, another question (still working on the sprite stuff from another question, but in the meanwhile); how can I include a ttf file for Pixi to use. It seems that every example I see does not work for me. It is a ttf file that is not available standard in browser, it needs to be included. If anyone can provide me with a an example, just the basics, I'd be very happy :-) Thanx.
  4. Enigmafan

    ID of sprite

    @Powerfear: Thanx for your explanation, I will give that a try. @Rolnaaba I am not sure whether that will work. I think I understand your explanation of the 'this' keyword. But let me give you an example, You probably know the game where you have 15 blocks in a 4 by 4 square where you can move one block to the empty spot (not sure what is called), in ascii: 1 3 15 2 7 11 13 4 9 8 10 12 5 6 13 X These are my 15 sprites and one empty spot right/down. Sprite 13 can move right, sprite 12 can move down. How can I tell the Sprite Object represented by 'this' that he represents for instance sprite 12 and can move down? And ofcourse, as soon as sprite 12 is in the spot where X is now, sprite 12 can only move up, sprite 13 can't do anything, sprite 10 van move right and sprite 4 can move down.
  5. Enigmafan

    ID of sprite

    Hello all, I have just stated using pixi.js (and linking it :-) as well as javascript. I usually program in Java. When I create a bunch of sprites, I put them in an array to keep track of them. The user is able to click on the sprite and drag it along. But I need to check the direction the sprite may move to, which is different for every sprite. But when the ontouch or similar event is triggered, I have no way to correlate the sprite touched with the sprite in my array. I have looked through the api, but found no way to do this. The solution I've come up with is; extend the sprite object (as you would in java) and include an ID or other reference. But my programming skills in javascript are not enough to know if that is possible. Does anyone have a suggestion if this is a good solution? Does anyone have another solution? Thanks.