soul

Members
  • Content count

    8
  • Joined

  • Last visited

  1. So I've got some pixel art, in which I've got a base character who is naked, and then I've got items that match the animation of this base character, helmets, bodies, legs, etc. I need the items to be over the character z-index wise (I'm using Pixi DisplayGroups currently for z sorting), because obviously we can't sort by Y, or else a helmet would appear under the base sprite for example. So we must put it on a higher layer. The issue then is, if I walk over other sprites (monsters or whatever), since the armor is on a higher layer, the armor will render over their sprites always, while my underneath base sprite is of course Y sorted normally. So I need a way to put all the items over the character, but keep it on the same z layer so that it can be y sorted properly. I was looking at RenderTexture but there doesn't seem to be a way to do it animated? Do I add all the items to the base sprite as a child? I tried this but it seems the sub items don't move when I move the base sprite position. Or do I create an entirely new container, and add all the sprites to it, base sprite, items etc. Then set the z-layer of the entirely new container I just created? I did this but when moving the container, the sprites inside it were all offset by a huge huge margin and not actually at the X and Y I was specifying. Thanks
  2. Text Input?

    Yeah I'll just go ahead and roll my own Text input then, thanks! Also, I'm stupid, I was calling .preventDefault in my current movement code, that's why the HTML input wasn't working... oops haha. EDIT: Just found this: https://github.com/limikael/PixiTextInput It works, but it's missing a lot of features, but a good place to start, I'll just add the features it's missing on it's TO-DO list.
  3. Proper way to scale game with Pixi v4?

    I got this to work, but it dropped my FPS to about 15, vs where if I just up the resolution setting I easily maintain 60 FPS. Not sure why it's dropping my fps? I'm wondering if I should somehow calculate the page size then set the resolution setting according to the page size or something? Thanks for your reply by the way!
  4. Text Input?

    What is the best way to make a Text Input? I've been researching for hours and trying so many things and can't seem to get a text input working at all. When using a regular HTML text input, the textbox seems to have focus if I click on it, but typing inside of it does nothing. I assume this is due to Pixi taking all input? How can I stop this? Better yet is there any Text Input that works directly inside Pixi? I seen some projects people created before for text input for Pixi, but those are extremely old and none of them work. I even tried to port them from Pixi v2, but with no luck. I also tried https://github.com/goldfire/CanvasInput but it seems to not work either with Pixi. I can get a text input showing up using a seperate canvas, but not Pixis.
  5. I've got a low res pixel art game, and my desired resolution of the game is 320x180. I then want to take that 320x180 and scale it up to fit whatever the browser size is, and of course it can black bar whatever doesn't match 16:9 ratio. Currently I set the resolution option to 4, and when I try to use other examples of resizing I've seen online, none of them seem to do what I want. Either they scale the game so big I have scroll bars, or it made the in game resolution the size of the window which is for sure not what I want, the game needs to maintain that 320x180 viewport but just scaled up. Any chance I could get some small example code on how to just take my ingame 320x180 resolution and scale it to the browser window?
  6. PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; Set that property. Though do note this will make the DEFAULT change, so every image you load will be like this, and it might not be what you desire. If you don't want to change the default, but only for that one texture, set it on that texture directly instead.
  7. Best way to handle AnimatedSprites?

    Alright thanks
  8. Should I just have one AnimatedSprite that contains all my frames for everything (walking in each direction, attacking in each direction, etc etc), or should I have one AnimatedSprite per animation (one AnimatedSprite for walking left, one AnimatedSprite for walking right, attacking left, attacking right, etc)? It seems like it'd be annoying having to set x and y for each AnimatedSprite if they were all seperate, so I'm assuming just one AnimatedSprite with it containing all the frames would be the best solution