Git Product home page Git Product logo

Comments (11)

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

I've uploaded a FLASH production guideline doc.
Can you please take a look this documentation?

http://gree.github.com/lwf-demo/pdf/FLASHforLWFproductionguideline.pdf

from lwf.

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

You can verify your FLASH scene in FLASH environment by using LWF_Publish.jsfl.
LWF_Publish.jsfl is available in the "tools/flash" directory.

https://github.com/gree/lwf/blob/master/tools/flash/LWF_Publish.jsfl

Installing JSFL Scripts
http://summitprojectsflashblog.wordpress.com/how-tos/installing-jsfl-scripts/

from lwf.

phamvanan avatar phamvanan commented on September 3, 2024

I try to bulid project tools swf2lwf but errors.
Can you post tutorial install detail that project, please?

Thanks and Regards.

from lwf.

camelot10 avatar camelot10 commented on September 3, 2024

tested. seems like export works. my animations works in unity

from lwf.

Adamcbrz avatar Adamcbrz commented on September 3, 2024

I agree with having a tutorial. I can't seem to get sprite atlas to work with the animation. I can't seem to find any tutorials on this besides swf2lwf command line but I can't seem to get that to work. If any one has had success on this PLEASE help me out.

Thanks!

from lwf.

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

Thank you Adamcbrz.
Sprite atlas works perfectly with LWF. Actually, we prefer to use atlas for reducing number of draw calls. The swf2lwf supports json file that is exported from Texture Packer (http://www.codeandweb.com/texturepacker).

Can you please take a look Texture Packer.

Anyway, a tutorial for converting swf by using Texture Packer's json data would be required...
I'd like to take a look it.

from lwf.

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

Here is a quick tutorial for making sprite atlas for LWF:)
The tutorial file has been added to "flash" folder under https://github.com/gree/lwf-demo/ project.
If you have any questions for following step, please feel free to ask.

  1. Extract png files from the swf file.

ruby swf2lwf.rb sprite_atlas.swf

  1. All png files are extracted and stored in sprite_atlas.lwfdata folder.
  2. Create texture sheet with exporting placement information to json file

/Applications/TexturePacker.app/Contents/MacOS/TexturePacker --format json --data sprite_atlas.json --sheet "sprite_atlas_texture.png" sprite_atlas.lwfdata/*.png

  1. A texture atlas "sprite_atlas_texture.png" and json data " sprite_atlas.json" are generated.
  2. Re-convert swf into lwf with json data.

ruby swf2lwf.rb sprite_atlas.swf sprite_atlas.json

from lwf.

Adamcbrz avatar Adamcbrz commented on September 3, 2024

First thanks for getting back to me!

Thats what I had figured out but when I run through this process and import it to Unity I see the animation on meshes but the atlas doesn't show correctly. Every Mesh shows the entire atlas. My process is as follows:

  1. Publish swf using LWF_Publish.jsfl (No Errors)
  2. Use the LWFS to convert to lwf and extract the images.
  3. Use those images in Texture Packer to generate an Atlas save as JSON (Hash)
  4. Run ruby script "ruby swf2lwf.rb Jake.swf Jake.json" (outputs with no errors)
  5. Include the files in the Unity Project
  6. In unity I have a script from your Unity Video demo and put the path to the text.bytes and path to the images.
  7. I debug some of your code and realized that its expecting the atlas name to be TeethBitmap.png so I renamed my image to that.
  8. I hit play and I see the animation but all the meshes have the entire atlas instead of the UV location of the appropriate altas item

I will include the flash file and unity project to see if you can see what I am doing wrong.

Drop box link: https://www.dropbox.com/s/4d5es1xv74efc80/LWFTest.zip

Edit: I am using Unity 4.0.1

Thanks,
Adam

from lwf.

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

It seems swf2lwf.rb didn't handle given json file properly when images in Flash file has AS linkage...
I could have right lwf by removing some AS linkage in Flash files. See following screen shot.

I'd like to take a look processes of swf2lwf.rb, please wait for a moment.

Jake_in_Unity

from lwf.

HiroyukiHaga avatar HiroyukiHaga commented on September 3, 2024

Image file names that used for TexturePacker have to be as same as Linkage names.
In your process 2), LWFS extracts images with "<SWF_filename>_#.png" like "Jake_0.png" instead of Linkage name"Bitmap1.png".
You can generate right lwf file with removing process 2).

  1. Publish swf using LWF_Publish.jsfl
    This process extract all images from Flash, and save to "<SWF_filename>.bitmap" folder with Linkage name.
    In your case, "Jake.bitmap" will be generated.

  2. Generate TexturePack by using "<SWF_filename>.bitmap".

/Applications/TexturePacker.app/Contents/MacOS/TexturePacker --opt RGBA4444 --scale 1.0 --format json --data Jake.json --sheet "Jake_texture.png" Jake.bitmap/*.png

  1. Generate LWF file.
    swf2lwf Jake.swf Jake.json

  2. Open unity/basic2 project in https://github.com/gree/lwf-demo/ .

  3. Copy your resources to Resources/LWF/Jake folder, and rename Jake.lwf into Jake.bytes.

  4. Update OnGUI() method in "SampleMenu.cs" with following code.

void OnGUI()
{
    GUI.Box(new Rect(10,10,100,120), "Menu");
    if (GUI.Button(new Rect(20,40,80,20), "Sample 1"))
        PlaySample("sample1_normal");
    if (GUI.Button(new Rect(20,70,80,20), "Sample 2"))
        PlaySample("sample2_normal");
    if (GUI.Button(new Rect(20,100,80,20), "Sample 3"))
        PlaySample("sample3_normal");
    if (GUI.Button(new Rect(20,130,80,20), "Jake"))
        PlaySample("Jake");
}
  1. Click Play, and then click"Jake" button.

from lwf.

Adamcbrz avatar Adamcbrz commented on September 3, 2024

Thanks worked great!

from lwf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.