Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFL: Watch more libraries + gain live assets reloading #15

Open
sruloart opened this issue Jul 26, 2015 · 7 comments
Open

OpenFL: Watch more libraries + gain live assets reloading #15

sruloart opened this issue Jul 26, 2015 · 7 comments
Assignees
Milestone

Comments

@sruloart
Copy link

  • Watch the Assets folder: watching the 'Assets' folder for changes in .xml/.json/.png files (i.e. files that can be used as assets in an OpenFL project, also .ogg/.wav/.mp3/.m4a for SFX, .ttf, .otf for fonts and so on would be a nice addition :D) is much more useful than watching these on the Export folder since you don't ever work on the exported assets, you work on the assets in your Assets folder.
  • Except for the obvious benefits for this improvement (rebuilding the project with a newly modified version of an asset), in openFL v.>2.0.0 + desktop targets you can utilize live assets reloading (not unlike this) by just running "lime update" / "Openfl update" (no difference) while the application is running.
  • So, in haxe-watchify you can watch for changes in existing files in the 'Assets' directory, and instead of rebuilding the project for the desktop targets every-time, you can just run the command above (openfl update). Maybe some users would prefer to rebuild their project instead, so this can be an option.
  • Also, It can be very useful to watch the project.xml and the .hxml files inside the root of the project's folder, so you can tweak some important stuff on the go.

Sorry, it turned out a lot longer than intended :)

@lucamezzalira lucamezzalira self-assigned this Jul 26, 2015
@lucamezzalira lucamezzalira added this to the 1.3.0 milestone Jul 27, 2015
@lucamezzalira
Copy link
Owner

What I'm going to add in the next version will be:

  • watching new file extensions: .ogg .wav .mp3 .mp4 .m4a .ttf .otf
  • when livere load folder is specified I'm going to exclude from the watching directories so it will be "watched" only by the live reload server
  • explain better how live reload works in the documentation

could it works in this way or I missed something?

I've added the other request around openfl update in the backlog

@sruloart
Copy link
Author

First of all, Great! :) maybe .txt as well?

when live reload folder is specified I'm going to exclude from the watching directories so it will be "watched" only by the live reload server

I don't really understand what that line means :) but if it means you can specify which folders (any folders in the project directory) you want to watch / exclude from watching (in the hx-watch.json config file) then the answer is a big YES. And that's a lot better idea than mine.

The project.xml is still out of reach though, no? unless the "root" folder is also available to be watched. Maybe you can specify specific files to be watched? but that's pretty complicated, with the files paths and all.

@lucamezzalira
Copy link
Owner

Currently I'm excluding the following folders from the watcher:

  • output
  • dist
  • bin
  • export
  • Export
  • .idea

Plus, if specified, the livereload path specified in the configuration file or via command line

@lucamezzalira
Copy link
Owner

Added all the extensions requested, please check the new version 1.3.0 👍

@sruloart
Copy link
Author

Might take me some time to try all, tomorrow then :)

@lucamezzalira
Copy link
Owner

No rush! Take your time :-)

@sruloart
Copy link
Author

  • Very cool, now when I don't specify the source directory it watches everything but the export folder, including all the files extensions currently supported for changes,
  • and I can use one of the other default non-watchable folders (output/bin/dist...) to guard any files that I don't want to watch over (I can always move them to the Assets folder again, so that's handy).
  • The project.xml can now also trigger rebuild, which is great!

I think the default OpenFL's jsons on the website should have no src folder specified (so the user would have his Assets folder being watched by default). Also, it would be useful for the user to know about all of the non-watchable folders you've specified above.

Can I request more extensions to be supported? now that it's working I can see some missing:

  • .tmx (Tiled)
  • .swf (OpenFL can use them as assets)
  • .swc (You can use them in Flash builds).
  • .vert and .frag (Shaders)
  • .scml and.scon (Spriter) and .atlas (Spine)
  • .pex (particle designer)
  • .svg
  • .md
  • .bin
  • .zip
  • .csv and .tsv (localization with FireTongue, maps)
  • .po and .pot and .mo (localization)
  • .xm and .mml and .mid (music)
  • .woff and .eot (web fonts)
  • maybe more programming languages file formats for extern classes / extensions / etc (js, java...).
  • I probably am still missing quite a few :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants