Examples descriptors

已查看 24 次
跳至第一个未读帖子

Arian Fornaris Fernández

未读,
2018年1月22日 12:34:512018/1/22
收件人 Phaser 3 Development
Since Phaser v3 is the land of configurations and descriptors I think a descriptor file for the examples will be very helpful for tools.

For example, you can say that all the examples are placed in its own folder, like this:


examples/
  assets/
  scripts/
    load an image/
    play a sound/

But each example will have an example.json file with some useful information about it:

example.json:

{
  name: "Load an Image",
  assets: [
     "images/einstein.png"
  ],
  scripts: [
    "load an image.js"
  ]
  updated: "1/1/2018"
}

This descriptor file allows tools to parse the examples and provide operations like run the example, download it, start a project based on it, etc...

For example, in the current site http://labs.phaser.io you can edit an example but also download it. However, the download only includes the script file, not the assets, so it is not going to work in localhost. So a descriptor file allows tools to rebuild all the examples automatically and generate zip files with the assets and the scripts, so the user can download the complete example.

Best regards,
Arian 

Richard Davey

未读,
2018年1月22日 17:44:122018/1/22
收件人 Arian Fornaris Fernández、Phaser 3 Development
Hi,

What we could do is add something similar to a FrontMatter block to each example, giving it a version / author / description about what it does.

No external file info though, that would just be too much of a hassle to maintain I'm afraid!

We're going through and tidying up all the examples this week, purge out dead ones, fix broken ones, etc. So maybe could include this.

Cheers,

Rich

Photon Storm Ltd.

Skype: richard.davey
Twitter: @photonstorm

Registered in England and Wales.
Company ID: 8036404
VAT Number: 136 4333 27

--
You received this message because you are subscribed to the Google Groups "Phaser 3 Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phaser3-dev+unsubscribe@googlegroups.com.
To post to this group, send email to phase...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/phaser3-dev/a9dc2fcf-62a7-434a-8e18-80ff76e0370a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arian Fornaris Fernández

未读,
2018年1月22日 17:59:222018/1/22
收件人 Phaser 3 Development
Hi,

I think the bigger effort is at the first time. In Phaser Editor we do it automatically, by comparing the file names of the assets with the strings used in the examples. It works for the ~90% of the current examples.  
Anyway, it is something I can do in a separate repository, and if it proves it has value for the Phaser website we can merge it later, or not :)

I plan to do this kind of "metadata" stuff for Phaser Editor v2 and the Phaser v3 Chains.

Thanks for the reply,
Arian
回复全部
回复作者
转发
0 个新帖子