Dragon bones hide or remove slot texture?


How do you hide a texture or set a slot to null to hide that slot’s texture? Basically I have a character with a hat and I need to hide it or set its display to false.


Saw someone doing something like this and claimed it worked but I am unable to make it work:

var hat:Image = cast(_armature.getSlot("hat").display, Image);
hat.alpha = 0;   

Neither alpha or visible seem to have any effect in it even though it looks like this is being extended from starling’s Image class. Any suggestions out there?


So it appears I can get the alpha value but I am unable to set it. Am I supposed to call some type of redraw function?


Are you trying the Flash target? It might help just to be sure we don’t have any porting bugs or anything


No not targeting flash. Targeting CPP.


Could you try the Flash target, just to check if this seems to be target-specific, or if it’s possibly an issue in the port of DragonBones?


Unfortunately I have never been able to target flash. I can target everything else but flash.


When trying to target flash I get this error:

ArgumentError: Profile must be of type 'Context3DProfile' or 'Array'
	at starling.core::Starling/requestContext3D()
	at starling.core::Starling()
	at Startup()
	at DocumentClass()
	at ApplicationMain$/start()
	at MethodInfo-142()
	at lime.app::_Event_Void_Void/dispatch()
	at lime.app::Preloader/start()
	at openfl.display::Preloader/display_onUnload()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at openfl.display::DefaultPreloader/onLoaded()
	at openfl.display::DefaultPreloader/this_onComplete()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at openfl.display::Preloader/start()
	at lime.app::Preloader/updateProgress()
	at lime.app::Preloader/current_onEnter()

I am on a mac and have not tested on a windows machine to see if I get the same error. Ultimately I am not planning on targetting flash for my app. Although I get why you are asking, for debugging purposes.


Perhaps you have an older Flash version installed on your machine, the Starling demos work on my machine with Flash Player :confused:


No that’s not the case I installed the latest today and still getting this error.