Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TileList with custom ListItemRenderer problem

3 REPLIES 3
Reply
Message 1 of 4
serguei_k
421 Views, 3 Replies

TileList with custom ListItemRenderer problem

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!

3 REPLIES 3
Message 2 of 4
am964
in reply to: serguei_k

Hello-

Does this happen in the standard Scaleform player or only on the Unity Integration?

Please send us a repro case and instructions and we'll investigate.

Thanks,
Ankur
Message 3 of 4
serguei_k
in reply to: am964

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!

Message 4 of 4
serguei_k
in reply to: serguei_k

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report