PhaserJS 2.4 released with integrated Creature support!
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
No problem I am the author and creator of Creature. Thanks again for supporting the tool!
Cheers
No problem I am the author and creator of Creature. Thanks again for supporting the tool!
Cheers
Re: PhaserJS 2.4 released with integrated Creature support!
I am having serious trouble getting my first test animation to work with phaser. I tried it using both the Creature documentation as well as this example: https://phaser.io/examples/v2/animation/creature-dragon
I followed the steps and loaded the required files and get all kinds off errors depending on the approach. I am using phaser 2.8 and I think this might be a problem.
@abutkus I would be interested in your solution
Any other help is very much appreciated also.
I followed the steps and loaded the required files and get all kinds off errors depending on the approach. I am using phaser 2.8 and I think this might be a problem.
@abutkus I would be interested in your solution
Any other help is very much appreciated also.
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
What errors are you experiencing? What is the error printout you are getting?
Can you grab the runtimes from GitHub and try it out with the sample:
https://github.com/kestrelm/Creature_We ... -Demo.html
You will need to swap out the json files with any examples you have ( there are some from GitHub itself ).
Thanks
What errors are you experiencing? What is the error printout you are getting?
Can you grab the runtimes from GitHub and try it out with the sample:
https://github.com/kestrelm/Creature_We ... -Demo.html
You will need to swap out the json files with any examples you have ( there are some from GitHub itself ).
Thanks
Re: PhaserJS 2.4 released with integrated Creature support!
The Demo works out of the box, but when I exchange the phaser version with the current one, I get this:
Id be interested to hear if abutkus is using a plain phaser build or is it a custom one. Also I am wondering about the example on the phaser website where the code is much more straight-forward than in the creature docs. Why is that and which one is best to use?
Code: Select all
Uncaught TypeError: PIXI.Texture.fromImage is not a function
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
So:
Is a function that loads an image as a texture into Pixi's WebGL framework. Phaser in V2 variants uses the PIXI framework to load textures. As far as I can tell, this is the standard way to do it. The error you are experiencing is more of a general Phaser question: How do I load a texture into Phaser? If that function does not exist ( which is strange ), I wonder if they removed it or it is called something else.
You might want to try asking this more general question on the Phaser forums. If you find out a different answer ( as in it should be done a different way ), please let me know and I will update the code to load textures differently.
The code on the Phaser website is simpler because they did quite a bit of work to simplify the API. You can try theirs first since it hides a lot of the more complex operations from you. If you need more power/flexibility, use the one on the Creature GitHub page.
Cheers
So:
Code: Select all
PIXI.Texture.fromImage
You might want to try asking this more general question on the Phaser forums. If you find out a different answer ( as in it should be done a different way ), please let me know and I will update the code to load textures differently.
The code on the Phaser website is simpler because they did quite a bit of work to simplify the API. You can try theirs first since it hides a lot of the more complex operations from you. If you need more power/flexibility, use the one on the Creature GitHub page.
Cheers
Re: PhaserJS 2.4 released with integrated Creature support!
Thank you for the explanation, I thought so too. I think the direct access to pixi is not possible anymore, but wasn't able to find an alternate function yet. I have already posted on the phaser forums and I'm hopibg to get help there. I will inform you as soon as I got it working!
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
Actually I am looking at Phaser's Creature implementation here:
https://github.com/photonstorm/phaser/b ... reature.js
It does look like they are still accessing Pixi, including Pixi texture. So maybe all you need to ask is how to access those functions as well from your own code. Once that is solved, it should fix most of your issues.
Cheers
Actually I am looking at Phaser's Creature implementation here:
https://github.com/photonstorm/phaser/b ... reature.js
It does look like they are still accessing Pixi, including Pixi texture. So maybe all you need to ask is how to access those functions as well from your own code. Once that is solved, it should fix most of your issues.
Cheers
Re: PhaserJS 2.4 released with integrated Creature support!
Hey there!
I got it working now, after asking in this thread:
http://www.html5gamedevs.com/topic/2861 ... nstructor/
I am using phasers implementation, it was a matter of importing the ride files. However, it's possible to access the creature manager via CREATURE.manager, and I am encountering more problems with seemingly deprecated or buggy code there.
- For one, isPlaying never goes back to false after being set to true once, regardless if the animation is finished.
- there was a typo of some sort in line 7228 of creature.js, this here:
It needs to be "this.target_creature..."
- I am trying to use the blend function as described in the docs, but I get this error after fixing the previous point:
"Uncaught TypeError: this.blend_render_pts.set is not a function" in Line 7233 of creature.js, whích is this one:
EDIT:
Also, the version of creature.js in the phaser ce seems to be slightly different (and longer) than the one I got from the creature website, even though they've got the same version number in their header.
I got it working now, after asking in this thread:
http://www.html5gamedevs.com/topic/2861 ... nstructor/
I am using phasers implementation, it was a matter of importing the ride files. However, it's possible to access the creature manager via CREATURE.manager, and I am encountering more problems with seemingly deprecated or buggy code there.
- For one, isPlaying never goes back to false after being set to true once, regardless if the animation is finished.
- there was a typo of some sort in line 7228 of creature.js, this here:
Code: Select all
for(var i = 0; i < target_creature.total_num_pts * 3; i++)
- I am trying to use the blend function as described in the docs, but I get this error after fixing the previous point:
"Uncaught TypeError: this.blend_render_pts.set is not a function" in Line 7233 of creature.js, whích is this one:
Code: Select all
this.blend_render_pts.set(0, new_vec);
Also, the version of creature.js in the phaser ce seems to be slightly different (and longer) than the one I got from the creature website, even though they've got the same version number in their header.
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
Sorry yes that looks like a syntax bug. We are trying to add a new vector/point into an empty array.
Can you try something like this instead:
If that works, I will patch it in later.
Cheers
Sorry yes that looks like a syntax bug. We are trying to add a new vector/point into an empty array.
Can you try something like this instead:
Code: Select all
this.blend_render_pts.push(new_vec);
Cheers
Re: PhaserJS 2.4 released with integrated Creature support!
Seems to work, but there's more errors. Had to change "blending_factor" to this.blending_factor in lines 7196 and 7197 and there's another "set" instead of push in 7195.
Now I've got no more errors but it doesn't seem like there's anything more happening than that the animation just stops for some reason, even though I'm changing the BlendingFactor over time.
Now I've got no more errors but it doesn't seem like there's anything more happening than that the animation just stops for some reason, even though I'm changing the BlendingFactor over time.