palanolho

Members
  • Content count

    32
  • Joined

  • Last visited

About palanolho

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. palanolho

    [Help] best way to handle "paced" resolution things

    OK I'll have a go and see how it goes. Many thanks
  2. palanolho

    [Help] best way to handle "paced" resolution things

    So, in your suggestion, this means that I will need to use some global variable in order to track the "actions pending resolve" so that these functions can access it and do whatever needs to be checked/done, correct? When you say to use a timer, you mean to use the setTimeout() method or use something like this? https://github.com/husa/timer.js/ (any other/better suggestion?) Btw, I didn't mention, but in case it's relevant, I intend to use Spine for the animation.
  3. Hi everyone, I'm not sure if this is entirely a Pixi related question but, there may be something in Pixi that may help with this and maybe someone here would know the best way to do it. I'm building a prototype of a game where the player and the CPU will end up with a list of Actions and I will have to compare the outcome of those actions by comparing the 1st Player actions to the 1st CPU action, 2nd Player action with 2nd CPU action, etc... until all actions are resolved. I already have this working, however, the actions are resolved all in a single pass and that's it. In order to make things more interesting and be able to add some animations for the resolution of the outcomes, I would like (somehow) to be able to resolve the 1st Actions show the outcome and animations, then move to the 2nd action show the outcome and animations, etc... until all actions are resolved. As an example, let assume that the players have only 2 actions: the resolution of the first pair of actions would inflict 50 damage to the CPU and the resolution of the 2nd pair of actions would Heal 20 HP to the CPU. What I have at the moment shows only the end results (like CPU that a total of - 30 HP) What I'm trying to achieve is: 1st Actions : show the 2 actions in questions, show the outcome of the resolutions, make an animation, show the CPU losing 50 HP and move to the next action 2nd Actions : show the 2 actions in questions, show the outcome of the resolutions, make an animation, show the CPU healing 20 HP and move to the next action etc... The way I was thinking in approaching this, would be to handle the resolution of those actions inside a ticking function with a bunch of additional flags to help track in which state of the resolutions things are, BUT I'm not entirely sure if this is the correct/best way to do it. Has anyone ever done anything similar? Does anyone have any suggestions based on your experience? I'm using PixiJS with "pure" Javascript (and not typescript) if that is relevant in any way. Many thanks in advance for the assistance. - Miguel
  4. palanolho

    lineStyle alignment is not working?!

    👍Thanks !
  5. palanolho

    lineStyle alignment is not working?!

    ok got it. thanks is there a "link" that always points to the latest pixi version ?
  6. palanolho

    lineStyle alignment is not working?!

    PixiJS 4.7.1 - ✰ WebGL ✰
  7. palanolho

    lineStyle alignment is not working?!

    Hi everyone, I don't know if any of you is having the same issue or if it's only me doing something wrong but, the alignment property of the Graphic lineStyle doesn't seem to be working. No matter what value is set the alignment to, the like is always "centred". If you see attached example, the orange rectangle and the border rectangle has exactly the same size and are on the exact same position and no matter the value I set on the alignment, the line always looks like that (centred). Any ideas ? Many thanks,
  8. Hi everyone, I'm trying to use the additional pixi filters (https://pixijs.io/pixi-filters/docs/index.html). The documentation only explains how to get it using nmp but since I don't use it (at least at the moment) I was wondering how I could get the pixi-filters.min.js (or pixi-filters.js) to add to my code. I was able to find this reference for the CDNJS "https://cdnjs.cloudflare.com/ajax/libs/pixi-filters/1.0.8/filters.min.js" which seems to load fine, but when I try to use it I get either an "Uncaught ReferenceError: GlowFilter is not defined" or "Uncaught TypeError: PIXI.filters.GlowFilter is not a constructor" error (depending on how I try to define the filter). Tried a difference filter (like emboss) but get the same thing . (example as per https://pixijs.io/pixi-filters/docs/PIXI.filters.GlowFilter.html) var someSprite = new PIXI.Graphics(); someSprite.filters = [ new GlowFilter(15, 2, 1, 0xFF0000, 0.5) // doenst work with "new PIXI.filters.GlowFilter()" either ]; Any hints? Many thanks in advance for any assistance.
  9. palanolho

    Spine documentation for PixiJS

    OK found the issue... again, the files I downloaded were not the raw ones... >_>. Thanks for the help
  10. palanolho

    Spine documentation for PixiJS

    ok I was able to sort it out. I think it was something incorrect on the file I downloaded (maybe I didn't download the raw version...). So now I'm having a problem with the "res.spineboy.spineData". He doesn't know what the "res" is (or it's rather undefined). I have 2 loaders in my project. one for quick assets for the "loading screen" and the default everything else. Is that the problem? Is there any other way to load it? (I tried the example below but it complains that "The spineData param is required." new PIXI.spine.Spine(PIXI.loader.resources["spineboy"].spineData);
  11. palanolho

    Spine documentation for PixiJS

    @ivan.popelyshev (or anyone else who may know the answer) Sorry to ask again, but I downloaded the files you mentioned and included them on my html file, but I'm getting an "Uncaught TypeError: Cannot read property 'Spine' of undefined" on the line below (I'm pretty much copying the example and I have also downloaded and included the spineboy files in my project) PIXI.loader .add('spineboy', 'images/spine_animations/spineboy.json') .load(onAssetsLoaded); function onAssetsLoaded(loader, res) { var spineBoy = new PIXI.spine.Spine(res.spineboy.spineData); // <----- on this line var spineBoy = new PIXI.spine.Spine(res.spineboy.spineData); spineBoy.x = app.screen.width / 2; spineBoy.y = app.screen.height /2; spineBoy.interactive = true; spineBoy.buttonMode = true; // set up the mixes! spineBoy.stateData.setMix('walk', 'jump', 0.2); spineBoy.stateData.setMix('jump', 'walk', 0.4); // play animation spineBoy.state.setAnimation(0, 'walk', true); app.stage.addChild(spineBoy); spineBoy.on('pointerdown', function() { spineBoy.state.setAnimation(0, 'jump', false); spineBoy.state.addAnimation(0, 'walk', true, 0); }); } Also, do you think you could explain why in the spine example, the "onAssetsLoaded" include the "loader" and "res" in the arguments? what are they user for what are they exactly? Many thanks in advance. PS: don't know what happened but after adding the post the code snipper got broken and cant add the proper highlight
  12. palanolho

    [Question] Trigger sprite events manually

    Oh dum me... That's what I have! I have a function that is executed on "pointer up" and I totally forgot that lol. I can even out some validations to check "if the time is over" and in that case drop the sprite back on its original location. Thanks for the reminder
  13. palanolho

    [Question] Trigger sprite events manually

    botmaster Oh I know that, and that is not the case (I think?!) Imagin you have an inventory with slots and "items" on those slots. There are some equipment slots outside the inventory where you can drag&drop the item from the inventory slots into the equipment slots. However, I also have a timer and the player has a certain amount of time to equip whatever he wants to equip and change equipment. Once the time ends, the items lose their "interactivity" and the player won't be able to equip them anymore. The problem is that at the point the time expires, the player may be in the middle of dragging an item into a slot. and since the item loses its interactivity, it gets stuck where the "pointer" was when it lost its interactivity. So basically what I want to do when this happens is to move the item back into the slot as if the user was not dragging it. I know the original location of the item and the my "pointerup" function already makes validations regarding this and moves the item to the correct location if it's "dropped" on an invalid location. That's why I was trying to trigger the "pointerup" event on an invalid location to trigger this behaviour. Do you know any better/simpler way to do this ?
  14. palanolho

    [Question] Trigger sprite events manually

    Thanks @Exca, will give it a try. Do you know if there's any more general "touch" method that would allow to click on a given location of the screen? I'm not really sure if I will have access to the sprite being dragged and I want to make sure the event is triggered on an "empty space" many thanks in advance
  15. Hi everyone, I'm trying to do something that I don't know if it's possible nor what is the best/correct way to do it. Basically, I have a sprite that has "pointer..." events associated. Example: .on('pointerup', doSomething) This sprite is draggable and I can drop it in some other places. However, at some point, the sprite may lose it's "interactivity" (it's on purpose) and I would like the trigger the effect of "pointerup" so that the sprite is handled as if the user triggered that event (otherwise the sprite gets stuck on the locations the pointer was at the moment when the sprite lost its interactivity. So, my question is: Is it possible to trigger an event for a given sprite manually? or is there a better way to achieve what I'm trying to do? Many thanks in advance, - Miguel