LWF for C++ with Cocos2d-x renderer

Is there a way to make the background of LWFNode to be transparent instead of opaque black?

@siauw wrote:

Is there a way to make the background of LWFNode to be transparent instead of opaque black?

What do you mean? LWFNode itself doesn’t draw anything at all.

yes you’re right, as it turns out, the Layer that draws the background black, I’m still looking a way to make it transparent. Sorry it’s not LWFNode

@splhack I got it. Thanks!
Another two problems:
1.how to get a movieclip(say its name is “myMC”) and remove it from the lwf.
2.Is there a way to get the bitmap data of the lwf, or any other way to make me able to check the touches point in lwf has none-transparent pixel there ?
Thanks ahead.

@joni I have similar problem. I need to replace a picture dynamicly, but the picture name differs to different lwf. I tried publish for lwf, and the name problem solved but there is no .lwf file created.

@jianhan513@163.com wrote:

@splhack I got it. Thanks!
Another two problems:
1.how to get a movieclip(say its name is “myMC”) and remove it from the lwf.

What do you want to do? Please describe more detail.

2.Is there a way to get the bitmap data of the lwf, or any other way to make me able to check the touches point in lwf has none-transparent pixel there ?
Thanks ahead.

It’s not a part of LWF. Please search “Pixel Perfect Collision Detection in Cocos2d-x”.

@jianhan513@163.com
Could you share your fla file?

how can i fix it when i convert swf !!

swf2lwf.rb:2479:in parse_place_object2': undefined methodreference’ for nil:NilClass (NoMethodError)
from swf2lwf.rb:2693:in parse_tags' from swf2lwf.rb:2254:inparse_define_sprite’
from swf2lwf.rb:2693:in parse_tags' from swf2lwf.rb:2742:inparse_swf’
from swf2lwf.rb:3505:in swf2lwf' from swf2lwf.rb:4407:in’

@cbingt Could you share your fla file with me? we can’t fix it without fla file.

@splhack

hi~ splhack. i have a question.

i solved problem that change image(or texture).
…
std::regex re(“card\d+\.png$”);
LWF::LWF::SetTextureLoadHandler([=](std::string fullPath, std::string basePath, std::string filename) {
return regex_replace(fullPath, re, “card01.png”);
});
…

but, i don’t know that how can i change image on texture-atlas.
(i make use of texturepacker, json, …)

@manpage currently, LWF doesn’t support it.

@jianhan513@163.com thanks. your data has no problem. Could you check your ~/Desktop/LWFS_work_output/native?

bitmap_b.png	bitmap_c.png	bitmap_d.png	bitmap_e.png	testJaney.lwf

If I import swf, there is a grey outline on the image.
I had no problem on Flash program, so I’m not sure what is making this happen.
so if possible please check what the problem is.

@jamesYou It sounds the same as this problem http://www.pixelenvision.com/3273/texture-packer-the-tool-that-stands-the-test-of-time/ . I recommend you to try to use TexturePacker and “Reduce border artifacts” option just for the problem.

Is there a way to scale LWF with ResolutionPolicy::NO_BORDER? Because my other resources are made with this resolution policy.
Thanks

@siauw Have you tried it?

CCSize frameSize = cocos2d::Director::getInstance()->getOpenGLView()->getFrameSize();
lwfNode->lwf->FitForHeight(frameSize.width, frameSize.height);

will you make API for 3.0 rc ?
thanks!

@jamesYou we are almost done, but there is a clipping problem on rc0. In some cases, sprites doesn’t appear on the screen due to Sprite::isInsideBounds returns false. we’re now investigating it.

@splhack wrote:

@jamesYou we are almost done, but there is a clipping problem on rc0. In some cases, sprites doesn’t appear on the screen due to Sprite::isInsideBounds returns false. we’re now investigating it.

Very looking forward to LWF update on rc0, thanks for your great jobs