PhaserJS 2.4 released with integrated Creature support!
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
That means the flat data was not loaded properly. Either the flat data you provided was invalid or something else is going on.
The pointsArray() wasn't found in the flat data file.
That means the flat data was not loaded properly. Either the flat data you provided was invalid or something else is going on.
The pointsArray() wasn't found in the flat data file.
Re: PhaserJS 2.4 released with integrated Creature support!
What can I do about that?
The file is from the same export as a working json file. I also tried manually converting it as described in the documentation. The json works, the flatdata doesn't. If the code is correct, I don't know what I could do..
The file is from the same export as a working json file. I also tried manually converting it as described in the documentation. The json works, the flatdata doesn't. If the code is correct, I don't know what I could do..
Re: PhaserJS 2.4 released with integrated Creature support!
You do not need to run any manual conversion process, the flat data file already exists in your export folder.
Open up your export folder when you exported out your game assets, you should see a flat data file with the extension called ".bytes".
Use that file as your flat data file.
Open up your export folder when you exported out your game assets, you should see a flat data file with the extension called ".bytes".
Use that file as your flat data file.
Re: PhaserJS 2.4 released with integrated Creature support!
Yup, as I said, I tried that one first...
Re: PhaserJS 2.4 released with integrated Creature support!
So I just tried exporting out a Flat Data and loading it in Phaser with no issues, I am not sure what is going on at your end.
Do you mind sending me over in a zip just your Creature Project on the cloud?
Thanks
Do you mind sending me over in a zip just your Creature Project on the cloud?
Thanks
Re: PhaserJS 2.4 released with integrated Creature support!
Oh wait one more thing,
Do you do the following to load your binary flat data:
Did you have a binaryLoadcallback to convert your flatData into a Uint8Array?
Then when actually loading:
Do you do the following to load your binary flat data:
Code: Select all
function preload () {
game.load.binary('solBin', 'soldier_character_data.bytes', binaryLoadCallback, this);
game.load.image('solTexture', 'soldier_character_img.png');
}
function binaryLoadCallback(key, data) {
// Convert our binary file into a Uint8Array
// We must return the data value or nothing will be added to the cache, even if you don't modify it.
return new Uint8Array(data);
}
Did you have a binaryLoadcallback to convert your flatData into a Uint8Array?
Then when actually loading:
Code: Select all
var actual_data = CreatureModuleUtils.LoadCreatureFlatData(game.cache.getBinary('solBin'));
new_creature = new Creature(actual_data, true);
Re: PhaserJS 2.4 released with integrated Creature support!
Okay, no, this I didn't do. Let me try.
Re: PhaserJS 2.4 released with integrated Creature support!
That did it. Great, thanks!
Maybe you should add that to the documentations, or did I overlook something?
Maybe you should add that to the documentations, or did I overlook something?
Re: PhaserJS 2.4 released with integrated Creature support!
Hello,
Great to know it runs. Actually, this is the standard way you should load binary data in Phaser:
https://github.com/photonstorm/phaser-e ... %20file.js
I assumed the user already understands the standard way of doing it. For the web, you should always convert it into a Uint8Array when loading a binary ( standard practice ). Please take a look at Phaser's official example.
Great to know it runs. Actually, this is the standard way you should load binary data in Phaser:
https://github.com/photonstorm/phaser-e ... %20file.js
I assumed the user already understands the standard way of doing it. For the web, you should always convert it into a Uint8Array when loading a binary ( standard practice ). Please take a look at Phaser's official example.
Re: PhaserJS 2.4 released with integrated Creature support!
Ah, I see.
I searched for it in the phaser docs and used the loadBinary function but didn't look at the example to see that it wouldn't suffice, my bad.
I searched for it in the phaser docs and used the loadBinary function but didn't look at the example to see that it wouldn't suffice, my bad.