public void SetSelectedControlNameInList(List <string> value, UIEditorScene uiEditorScene)
        {
            var uiControl = uiEditorScene.uiControl;

            if (value == null || uiControl.Index < 0 || uiEditorScene.Scene.Controls.Count <= 0)
            {
                return;
            }
            var entity = uiEditorScene.Scene.Controls[uiControl.Index];

            uiEditorScene.UpdateOutLine(uiEditorScene.SelectedEntity2DList);
            uiControl.ControlName  = value[value.Count - 1];
            uiControl.controlLayer = entity.RenderLayer;
            uiControl.EntityWidth  = entity.DrawArea.Width;
            uiControl.EntityHeight = entity.DrawArea.Height;
            if (uiEditorScene.SelectedEntity2DList.GetType() == typeof(Button) ||
                uiEditorScene.SelectedEntity2DList.GetType() == typeof(InteractiveButton))
            {
                uiControl.contentText = ((Button)entity).Text;
            }
            else if (uiEditorScene.SelectedEntity2DList.GetType() == typeof(Label))
            {
                uiControl.contentText = ((Label)entity).Text;
            }
            else
            {
                uiControl.contentText = "";
            }
        }
Example #2
0
 public void SetHeight(float value, UIControl uiControl, UIEditorScene uiEditorScene)
 {
     var selectedEntity2D = uiEditorScene.SelectedEntity2D;
     if (uiControl.isClicking || selectedEntity2D == null)
         return;
     uiControl.EntityHeight = value;
     var rect = selectedEntity2D.DrawArea;
     rect.Width = uiControl.EntityWidth;
     rect.Height = uiControl.EntityHeight;
     selectedEntity2D.DrawArea = rect;
     if (selectedEntity2D.GetType() == typeof(Button))
         ChangeButton((Button)selectedEntity2D, uiControl);
     uiEditorScene.UpdateOutLine(selectedEntity2D);
 }
Example #3
0
		public void SetWidth(float value, UIEditorScene uiEditorScene)
		{
			var uiControl = uiEditorScene.uiControl;
			foreach (var selectedEntity2D in uiEditorScene.SelectedEntity2DList)
			{	
				if (uiControl.isClicking || selectedEntity2D == null)
					return;
				uiControl.EntityWidth = value;
				var rect = selectedEntity2D.DrawArea;
				rect.Width = uiControl.EntityWidth;
				rect.Height = uiControl.EntityHeight;
				selectedEntity2D.DrawArea = rect;
				if (selectedEntity2D.GetType() == typeof(Button))
					ChangeButton((Button)selectedEntity2D, uiControl);
			}
			uiEditorScene.UpdateOutLine(uiEditorScene.SelectedEntity2DList);
		}
Example #4
0
 public void SetSelectedControlNameInList(string value, UIControl uiControl,
     UIEditorScene uiEditorScene)
 {
     if (value == null || uiControl.Index < 0 || uiEditorScene.Scene.Controls.Count <= 0)
         return;
     uiEditorScene.SelectedControlNameInList = value;
     uiEditorScene.SelectedEntity2D = uiEditorScene.Scene.Controls[uiControl.Index];
     uiEditorScene.UpdateOutLine(uiEditorScene.SelectedEntity2D);
     uiControl.ControlName = value;
     uiControl.controlLayer = uiEditorScene.SelectedEntity2D.RenderLayer;
     uiControl.EntityWidth = uiEditorScene.SelectedEntity2D.DrawArea.Width;
     uiControl.EntityHeight = uiEditorScene.SelectedEntity2D.DrawArea.Height;
     if (uiEditorScene.SelectedEntity2D.GetType() == typeof(Button))
         uiControl.contentText = ((Button)uiEditorScene.SelectedEntity2D).Text;
     else if (uiEditorScene.SelectedEntity2D.GetType() == typeof(Label))
         uiControl.contentText = ((Label)uiEditorScene.SelectedEntity2D).Text;
     else
         uiControl.contentText = "";
 }
        public void SetHeight(float value, UIEditorScene uiEditorScene)
        {
            var uiControl = uiEditorScene.uiControl;

            foreach (var selectedEntity2D in uiEditorScene.SelectedEntity2DList)
            {
                if (uiControl.isClicking || selectedEntity2D == null)
                {
                    return;
                }
                uiControl.EntityHeight = value;
                var rect = selectedEntity2D.DrawArea;
                rect.Width  = uiControl.EntityWidth;
                rect.Height = uiControl.EntityHeight;
                selectedEntity2D.DrawArea = rect;
                if (selectedEntity2D.GetType() == typeof(Button))
                {
                    ChangeButton((Button)selectedEntity2D, uiControl);
                }
            }
            uiEditorScene.UpdateOutLine(uiEditorScene.SelectedEntity2DList);
        }
Example #6
0
		public void SetSelectedControlNameInList(List<string> value, UIEditorScene uiEditorScene)
		{
			var uiControl = uiEditorScene.uiControl;
			if (value == null || uiControl.Index < 0 || uiEditorScene.Scene.Controls.Count <= 0)
				return;
			var entity = uiEditorScene.Scene.Controls[uiControl.Index];
			uiEditorScene.UpdateOutLine(uiEditorScene.SelectedEntity2DList);
			uiControl.ControlName = value[value.Count - 1];
			uiControl.controlLayer = entity.RenderLayer;
			uiControl.EntityWidth = entity.DrawArea.Width;
			uiControl.EntityHeight = entity.DrawArea.Height;
			if (uiEditorScene.SelectedEntity2DList.GetType() == typeof(Button) ||
				uiEditorScene.SelectedEntity2DList.GetType() == typeof(InteractiveButton))
				uiControl.contentText = ((Button)entity).Text;
			else if (uiEditorScene.SelectedEntity2DList.GetType() == typeof(Label))
				uiControl.contentText = ((Label)entity).Text;
			else
				uiControl.contentText = "";
		}