gree / lwf Goto Github PK
View Code? Open in Web Editor NEWLWF - Lightweight SWF
Home Page: http://gree.github.com/lwf/
License: zlib License
LWF - Lightweight SWF
Home Page: http://gree.github.com/lwf/
License: zlib License
i try to build project ruby of gree/lwf but got errors.
Thanks any answers for me.
1
execute 'Publish for LWF' on Adobe FLASH,
make xxxxx.bitmap folder and export some png image files.
2
makes above image files and bytes data loaded unity.
3
run Unity preview..but display only white image(don't load png texture?).
After that , image file name change to 'xxxxx_0.png' , function well.
4
Next,
for example , 'test0.png' , 'test2.png' , 'test3.png' under putting Adobe Flash.
execute 'Publish for LWF' and make an easy rename 'xxxxx_0.png' , 'xxxxx_1.png' , 'xxxxx_2.png'.
and above image files and bytes data loadde unity.
But , seems to be afield from image order.
How do LWF decide image name rule?
I've been sent a pack of image sequences in form of JPEGs that I import to flash to animate it. I tried LWFS but it don't accept the published swf from Flash tool. Is there a workaround to play the SWF using only its frame information?
Hello,
we have issues with z-index order in flash animations when we're trying to embed them in unity. Here's the example:
http://artvanguard.info/warehouse.html
comparing to swf animation here:
http://artvanguard.info/introScreen2.html
you can see that the right hand is beyond the rest of the graphics and there's no mouth (probably also beyond).
Can you please help?
Hi,
is it possible to limit animation on GUI layer or something similar?
some of my animations are intent for HUD where I need 2D behavior + fixed position.
thanks!
I want to replace a image texture with another, I see somebody do this with unity. Is it possible with cocos2d-x, and how?
I've been attempting to render multiple LWFs using html5 without success for a while now.
The only result I've been able to achieve is attaching one LWF to another via ".attachLWF()", but using that technique I seem to loose the ability to sort the seperate LWFs on the z depth, so I can have the ability to determine which lwf is placed ontop of the other.
The main problem is when I try to render more then one LWF only the last lwf gets rendered.
Help would be much appreciated. The main parts of my code are: (this is just sorta pseudo code)
var lwfFileName = ["0.lwf", "1.lwf","2.lwf"]; //list of lwf files im using
var lwf = []; // Store an array of LWF objects
var lwfObjList = []; // Allows me to control position/scale properties of each individual LWF.
for (i in lwfFileName.length){
lwfCache.loadLWFs( lwf:lwfFileName[i] ,stage:myStage ,onload:handleLoad)
}
function handleLoad(l) {
lwf.push(l);
lwfObjList.push(l.rootMovie);
}
function tick() {
for (i in lwf){
lwf[i].depth = i; // I assume this will overlay the the lwfs based on they're position in the array. Never was able to make this work.
lwf[i].exec();
lwf[i].update(); // because I disable update
lwf[i].render(); // The main problem is here. Only one lwf gets rendered at the end on this loop.
}
}
Hi,
my main flash movieclip is created with several movieclip symbols:
When I export it with LWFS and load it in Unity, applying this code:
attached_movie = lwf.rootMovie.AttachMovie(linkage_name, linkage_name + "1");
attached_movie.Scale(0.0012f, 0.0012f);
and what happens is that in Unity each movieclip symbol gets its own Z position in world making it unusable:
without this "Scale" part it looks good but oversized:
One of the reasons of this scaling tryout is cause when I use the basic scaling of GameObject in Unity, image quality gets degraded drastically with decreasing a screen size - also, is there any other way of resize of lwf movie without losing on quality?
thank you on all of your help and keep up the good work!
lwf.dll will not be generated with following command whne gmcs is not in your PATH.
cd csharp/unity/build
rake
trying to get texture atlas created with texturepacker working since we use LWF so much that the frame rate start to slow down... (too many draw calls probably).
Getting this error when trying to extract the PNG from the swf...anyone have any ideas?
zoomcrypt-macbook-pro:swf2lwf zoomcrypt$ ruby swf2lwf.rb -p /Users/zoomcrypt/Desktop/LWFS_work/piece_blue.swf
swf2lwf.rb:224:in export_png': uninitialized constant Img::ARGB8888 (NameError) from swf2lwf.rb:1037:in
export_png'
from swf2lwf.rb:4203:in block in swf2lwf' from swf2lwf.rb:4203:in
map'
from swf2lwf.rb:4203:in swf2lwf' from swf2lwf.rb:4250:in
There is few hints on how to do it but there is no clear tutorial on how to do it. So far its quite complicated to understand. Could it be possible to make a tutorial like you did in here: http://www.youtube.com/watch?feature=player_embedded&v=A_AhTosm1NU
Hi everyone,
I have a strange behavior while using this code:
iHeadCount = (int)Mathf.Floor(UnityEngine.Random.Range(1,8));
lwf.AddMovieEventHandler("head", postLoad:(mov2) =>{
mov2.GotoFrame(iHeadCount);
});
iHeadCount is a frame number representing the different head (max 8 frames) on one of my characters.
What happens is that it doesn't get called every time - I instantiate 10 of those characters and I get headless ones :)
Strange is that it's random, sometimes I get 4 with heads and 6 without and I can't pinpoint what I did wrong...
Thank you for your great support!
Hello,
We have noticed that using an LWF animation seems to cost a large amount of memory, but we aren't sure why.
We have one LWF animation with about 3.5 mb worth of textures, but when it is added to the scene, memory goes up by about 20 mb.
Another animation has about 17.7 mb worth of textures, and raises the memory by 80 mb.
Has anyone experienced this before, or know any ways to lower the memory used when running an LWF animation?
could you post any example with cocos2d-html5? the loader always return a null value in my tests
Can you please help me ?
I am trying to use sprite sheet, but I don't quite get how it works.
this is what i have gotten so far.
test.swf, test_texture.json , test_texture.png to LWFS_WORK to make the converting happen,
but it seems like it's only using test.swf...
can you help me out thank you so much :)
Japanese version readme for Japanese users.
what's happend....
NullReferenceException: Object reference not set to an instance of an object
LWF.Movie..ctor (LWF.LWF lwf, LWF.Movie parent, Int32 objId, Int32 instId, Int32 matrixId, Int32 colorTransformId, Boolean attached, LWF.MovieEventHandlers handler) (at Assets/Plugins/core/lwf_movie.cs:130)
LWF.LWF.Init () (at Assets/Plugins/core/lwf_core.cs:282)
LWF.LWF..ctor (LWF.Data lwfData, IRendererFactory rendererFactory) (at Assets/Plugins/core/lwf_core.cs:181)
LWFObject.Load (System.String path, System.String texturePrefix, System.String fontPrefix, Single zOffset, Single zRate, Int32 renderQueueOffset, UnityEngine.Camera camera, Boolean autoUpdate, System.Func2 lwfDataCallback, System.Action
1 lwfLoadCallback, System.Action1 lwfDestroyCallback, System.Func
2 lwfDataLoader, System.Func2 textureLoader, System.Action
1 textureUnloader) (at Assets/Plugins/wrapper/LWFObject.cs:190)
Simple.Start () (at Assets/Simple.cs:10)
NGUI v.2.5.0
Error:
Assets/Plugins/UILWFObject.cs(6,28): error CS0246: The type or namespace name `UIWidget' could not be found. Are you missing a using directive or an assembly reference?
Is there anyway to change the lwf animation by symbol name?
For example
i need symbol name "wait" work 3 seconds for loop,More than 3 seconds change to symbol "attack" and not want loop, just one time.
by the way,how to set animation loop or not....
Sometime, LWFResourceCache::unloadLWF does not finish because it waits for lock released.
I think that the problem is caused by this.
I tried to remove line of 193, the problem is fixed (I know it is dangerous)
Hi,
I can see this option exists in demos, but after following instructions for creating new Unity project:
https://github.com/gree/lwf/wiki/ForUnity
I'm missing that option and don't know how to add it without reusing one of demos projects for my own personal use.
Thank you!
it's quite hard to make animation in cocosbuilder for cocos2d-x, if lwf can support to cover to ccb format, that would be great
i cant edit fla file ...so plz tell me another way to detect the movie done...
void Start()
{
string dir = string.Format("{0}/", file_name);
string path = dir + file_name;
Load(path:path, texturePrefix:dir,enterFrame: enterFrameCallback);
lwf.rootMovie.AttachMovie("test","test",enterFrame:enterFrameCallback);
}
void enterFrameCallback( LWF.Movie movie )
{
if (movie.currentFrame == movie.totalFrames || !movie.playing) {
if(movie.name == "test"){
lwf.rootMovie.DetachMovie("test");
lwf.rootMovie.AttachMovie("test2","test2");
}
}
IT's worked but display erro.like this
InvalidOperationException: tree modified
System.Collections.Generic.RBTree+NodeEnumerator.check_version ()
System.Collections.Generic.RBTree+NodeEnumerator.MoveNext ()
System.Collections.Generic.SortedDictionary`2+ValueCollection+Enumerator[System.Int32,LWF.Movie].MoveNext ()
LWF.Movie.PostExec (Boolean progressing) (at Assets/Plugins/lwf/core/lwf_movie.cs:437)
I have noticed that a couple of assignments are used in the constructor bodies.
Examples:
The recommended way for performing efficient construction is to use the initialisation list.
has anyone properly updated the UILwfObject to work with NGUI3 and how it handles depth sorting?
Hi,
in Flash I have a subsymbol child_Sym with some tween motions that I add to my main symbol Parent_Sym.
Parent_Sym is used later in LWF via linkage name - but the problem is that I can control playback only of that Parent_Sym, but not the child_Sym in it.
Is there any way to control she child movieclip?
thank you very much for your answers!
Actually, dll is handy, but it's difficult to debug by adding break point.
lwf.dll shoud be replaced by C# code tree.
Wiki's instruction should be updated according to this update.
Hi,
I don't know why but regardless whether I use:
lwf.SetFrameRate(15);
it gets ignored by animation and it is played with some crazy fast rate.
I'm using it in this code:
public Camera camera;
void Start()
{
string dir = string.Format("{0}.swf/", "Canibals");
string path = dir + "Canibals";
Load(path:path, texturePrefix:dir, camera:camera);
lwf.SetFrameRate(15);
}
Any help would be much much appreciated!
thank you!
I'm getting many errors about UVWH, but I don't know what the problem is. What does this error mean?
I've been scouring the internet looking for how to go about this but for the life of me I can not get this to work. The scenario is I'd like to run my fancy script that replaces colors within a texture by creating a new texture. I would like LWF to use my new textures. I'm assuming I would use LWF.Format.TextureReplacement() however, I am completely at a loss on how or if this works?
i tryed by myself but got plenty of ruby errors.
only detect that flash version 7 supported for converting
Hi,
first of all thank you for this amazing tool set!!
Until now i was using LWF with single pngs, but since their count is increasing i'm now trying to use texture atlases.
Conversion seems to work (except the "is not rect" errors, that haven't been a problem with the single texture files)
but when i put everything in Unity (like in basic2), i get this error:
NullReferenceException: Object reference not set to an instance of an object
LWF.CombinedMeshRenderer.Factory..ctor (LWF.Data d, UnityEngine.GameObject gObj, Single zOff, Single zR, Int32 rQOff, UnityEngine.Camera cam, System.String texturePrfx, System.String fontPrfx, System.Func`2 textureLdr, System.Action`1 textureUnldr) (at Assets/Plugins/lwf/renderer/combinedmesh/lwf_combinedmesh_factory.cs:85)
LWFObject.Load (System.String path, System.String texturePrefix, System.String fontPrefix, Single zOffset, Single zRate, Int32 renderQueueOffset, UnityEngine.Camera camera, Boolean autoUpdate, System.Func`2 lwfDataCallback, System.Action`1 lwfLoadCallback, System.Action`1 lwfDestroyCallback, System.Func`2 lwfDataLoader, System.Func`2 textureLoader, System.Action`1 textureUnloader) (at Assets/Plugins/lwf/wrapper/LWFObject.cs:181)
What could be the problem?
Thanks in advance!
we are using LWF for Unity....the following code generally works but it seems to render the first frame of the movieclip before jumping to the label and continuing on....will investigate the unity renderer to see what is going on but curious if anyone has any idea or similar problem.
m_CurrentBossMovie = bossObj.lwf.rootMovie.AttachMovie(clipName, "walk01");
m_CurrentBossMovie.GotoAndPlay("angry");
I'm trying to build a game for windows 8 apps target build. Unity keeps complaining about these errors, perhaps due to removal of some linq features for windows 8 metro style app:
We are working on 2.5D game and FLW gives us really nice workflow and excellent results except for parts of FLW animation change their Z index when the perspectiv camera is used. Is there some way to fix this? Maybe forcing the elements to be rendered on different distances from the camera?
FAQ placeholder page should be added for resolving common issues.
Hello! LWF has been super handy for me so far. The only thing I cannot figure out is how to detect when a movie is done playing. I see that I can add a fscommand to the fla, but I can't seem to figure out how to detect the event inside Unity.
I tested the demos, and none appear to be working in IE11.
unity very powerfull and handfull tool.
viewing lwf in editor window without runing scene - that wouldd be awesome.
p.s. also maybe "Play in Editor" checkbox to animate
Adding js to the root timeline works as expected, but when I add js to a movieclip I get the warning "WARN: script not used [028_1_0_1]". The js in the movieclip does not execute, when the resulting lwf is run.
example js:
/* js
alert("test");
*/
I am using NGUI 2.6.5 with lwf extension
after I imported all the nessesary file, It throw this error :
no suitable method found to override OnUpdate()
no suitable method found to override keepMaterial
no suitable method found to override OnDrawSomething(can't remember)()
in UIBitmapFontLabel, UILWFObject, etc
Hello,
recently I am trying to switch animation by label,
luckly I found great example by you guys,
I took at look at the sample and follow exactly same step,
in Flash, and Unity,
when I did simple version with only two images,
it seems to work fine,
so I did it with much more complicated work,
but it just doesn't work , and I have no clue how to fix it.
I used exact same script and everything else in the unity,
do you think you can take a look at my flash file??
my flash file is at
https://www.dropbox.com/s/uj802oj27mh12eg/dragon02.zip
thank you so much for helping me out
Hi,
We've been trying to get a fairly simple swf imported into Unity, and have been running into trouble. We've reduced the issue to having multiple layers in a swf. Github wont let me attach swfs, but I can forward 2 very simple test swfs if anyone wants.
A swf with a single layer goes through LWF.CombinedMeshRenderer and works fine.
A swf with two layers goes through LWF.DrawMeshRenderer and doesn't show anything (although no failure, error, or warnings are sent as far as I can tell).
I've dug into the code a little bit, but it's slow going with no working examples for LWF.DrawMeshRenderer.
hi we are setting up for LWF for our game and have been succesfull with animations already. but when we added buttons to our flash they get lost in the conversion from SWF->bytes process. is there any information on how to set up buttons correctly in the flash file.
"I assume that you want to create new instance of symbol in library by specifying symbol's name in runtime. Is this correct understanding?"
yes.would you tell me how to do that.If possible,I need a simple example...
thank you so much...
we are using different movie clips in the library to handle multiple animations for a character. we currently use detach/attaach to switch animations, but it seems that often times the character will flickr (render blank) for a frame when we are changing animations....
i guess there is some delay in the loading and rendering of the animation or the first frame sometimes renders blank?
the code is simple just:
LWFObject pieceObj = m_CurrentPiece.lwfObject;
m_CurrentPiece.lwfObject.lwf.rootMovie.DetachMovie(m_CurrentMovie);
m_CurrentMovie = null;
m_CurrentMovie = pieceObj.lwf.rootMovie.AttachMovie("surprise1", "surprise0", load:(m)=>{ m.Play(); } );
Is there sometihng we can do to avoid the flickering?
maybe we should be handling multiple animations a different way? we are going to try just putting them all into the root movie clip and using goto(label) instead.....
Hello :
Is it possible to load swf from Unity "assetbundle" instead of "Resources" folder ?
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.