Box2D Forums

It is currently Sat May 25, 2013 9:56 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Feb 03, 2011 11:54 am 
Offline

Joined: Tue Feb 24, 2009 4:10 pm
Posts: 564
Location: Michigan
umm, i know i have seen mayobutter post a jsfl script that lets you set component parameters (aka "component properties") for all selected items in flash.
i can't seem to find it in the forums, and it doesn't seem to be in the script folder with the polygon decomposition ones.

anyone know where i can find it?


Top
 Profile  
 
PostPosted: Thu Feb 03, 2011 12:54 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
https://github.com/jesses/wck/blob/mast ... perty.jsfl


Top
 Profile  
 
PostPosted: Thu Feb 03, 2011 3:24 pm 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
This is a beautiful script, :) I use it all of the time


Top
 Profile  
 
PostPosted: Wed Feb 09, 2011 10:02 am 
Offline

Joined: Mon Nov 15, 2010 5:49 pm
Posts: 10
I have come across an issue related to this topic. It has to do with overriding getter/setter properties of classes with [Inspectable] tags.

I extended ShapeBase in order to create a custom shape class. I wanted the default state of the shape to be 'Static' as opposed to 'Dynamic' so I overrode the type getter/setter and supplied an [Inspectable] tag to reflect the desired changes. Strangely the default behavior was still dynamic. This in spite of the fact that the 'type' property was set to 'Static' in the component inspector as well as in the component definition dialog window.

I found a work-around however. Apparently the ShapeBase class's _type variable doesn't need to be explicitly set (and maybe should not be set) if the inspectable metadata tag defines a default value. Also important is the order in which you declare the _type variable relative to the inspectable tag and the respective getter/setter methods.

Moving the declaration of the _type variable before the respective inspectable tag and ensuring that it was not initialized seemed to do the trick. But I had to modify the ShapeBase class to pull this off. Tweaking 3rd party code is something I try to avoid since I'm likely to break something. But given that the whole V3 component architecture is kind of wonky I figured it would be good to point this out.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group