Exemplo n.º 1
0
	public static UIStateButton create( UIToolkit manager, string[] filenames, string[] highlightedFilenames, int xPos, int yPos, int depth )
	{
		
		// grab the texture details for the initial state
		var firstNormalTI = manager.textureInfoForFilename( filenames[0] );
		var frame = new Rect( xPos, yPos, firstNormalTI.frame.width, firstNormalTI.frame.height );

		// get the initial highlighted state
		var firstHighlightedTI = firstNormalTI;
		if (highlightedFilenames.Length > 0) {
			manager.textureInfoForFilename( highlightedFilenames[0] );
		}
		
		var button = new UIStateButton( manager, frame, depth, firstNormalTI.uvRect, firstHighlightedTI.uvRect );

		button.addFrames(filenames, highlightedFilenames);
		
		return button;
	}
Exemplo n.º 2
0
	private void onStateChange( UIStateButton sender, int state )
	{
		Debug.Log( "Button is at state: " + state );
	}