Hi all,
I have a problem with using a custom renderer in the tile list.
I needed a tile list that could display items as icons so I extended the ListItemRenderer to accomodate this functionality. If the renderer recieves data with an icon path it will use the Loader to load the image and then add it as a child to a MovieClip container at the bottom later.
The problem I am having is that once I add the Loader instance as a child the hover/click/etc states don't seem to scale correctly with the column and hieght size that is set by the TileList.
If I query the actual size of the renderer I get the correct numbers back however the drawing of overlays is still at the original size of the renderer.
Any help would be greately appreciated,
Thanks!
Hi Ankur,
I tried this with just a separate renderer outside of the TileList and get the same issues.
The problem happens with Scaleform player, I haven't gotten to the stage of trying this in Unity.
Here's simple example of how I am extending the Item Renderer to load icons, perhaps I'm missing something...
package { import flash.display.Loader; import flash.display.MovieClip; import flash.events.Event; import flash.net.URLRequest; import scaleform.clik.controls.ListItemRenderer; public class ListItemIconRenderer extends ListItemRenderer { public var iconLoader:Loader; public var bg:MovieClip; public function ListItemIconRenderer() { super(); iconLoader = new Loader(); iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedCb); } override public function setData(data:Object):void { iconLoader.load(new URLRequest(data.iconPath)); } public function loadedCb(event:Event):void { setActualSize(iconLoader.content.width, iconLoader.content.height); bg.addChild(iconLoader.content); } } }
Thanks for looking into this!
If anyone else is having the same issues, the current workaround I use is to set the size of the dynamically loaded content to the original size of the ItemRenderer component. Once the renderer gets rescaled to the desired size of the TileList all elements appear and behave correctly.