public SelectableTask(CanvasGroup group, Task task)
     : base(group)
 {
     this.group = group;
     this._task = task;
     Init ();
 }
Example #2
0
        public static UMLAssociation CreateNew(
			CanvasGroup group,
			DI.Diagram ownerDiagram,
			UML.Association associationModel )
        {
            return null;
        }
Example #3
0
        public UMLSelector(CanvasGroup group)
        {
            _selected_elements =new ArrayList();
            _rectangle = new CanvasRect(group);

            _rectangle.FillColorRgba = DefaultFillColor;
            _rectangle.OutlineColor = DefaultOutlineColor;
        }
Example #4
0
 public TimeTable(CanvasGroup group, TaskArea taskArea)
     : base(group)
 {
     this.group = group;
     this.taskArea = taskArea;
     Pixbuf = Gdk.Pixbuf.LoadFromResource ("Coolgrey-squared.png");
     CanvasEvent += OnCanvasEvent;
 }
            public CanvasGroupAlphaToAction(CanvasGroup _canvasGroup, float _desiredAlpha, float _actionDuration)
            {
                mCanvasGroup = _canvasGroup;
                SetGraph(Graph.Linear);
                SetDesiredAlpha(_desiredAlpha);
                SetActionDuration(_actionDuration);

                SetupAction();
            }
Example #6
0
 public UMLOpenArrow(CanvasGroup group)
     : base(group)
 {
     _arrowhead = new CanvasLine (group);
     _arrowhead.WidthUnits= 1.0;
     _arrowhead.FillColorGdk = UMLEdge.OUTLINE_COLOR;
     _arrowhead.Lower (1);
     Redraw ();
     _arrowhead.Show ();
 }
Example #7
0
 public UMLTriangularEnd(CanvasGroup group, FillKind kind)
     : base(group)
 {
     _kind = kind;
     _triangle = new CanvasPolygon (group);
     _triangle.WidthUnits= 1.0;
     _triangle.FillColorGdk = (kind == FillKind.Filled ? UMLEdge.OUTLINE_COLOR : UMLEdge.WHITE);
     _triangle.OutlineColorGdk = UMLEdge.OUTLINE_COLOR;
     _triangle.RaiseToTop ();
     Redraw ();
     _triangle.Show ();
 }
Example #8
0
        public UMLControlPoint(CanvasGroup group)
            : base(group)
        {
            if (_movable == true) { CPFillColor = DEFAULT_FILL_COLOR; }
            else { CPFillColor = DEFAULT_STATIC_FILL_COLOR; }

            OutlineColor = DEFAULT_OUTLINE_COLOR;
            WidthUnits = 1.0;
            CapStyle = Gdk.CapStyle.Round;
            CanvasEvent += CanvasEventCb;
            _container = null;
            Show ();
        }
Example #9
0
        public UMLEntry(
			UMLElement owner,
			DI.GraphNode graphNode,
			CanvasGroup group,
			bool isMovable,
			string text,
			string fontModifier
		)
            : base(group)
        {
            _graphNode = graphNode;
            Movable = isMovable;
            _owner = owner;
            _text = new CanvasText (this);
            _text.Text = (text == null ? System.String.Empty : text);
            _text.FillColor = "black";
            _text.CanvasEvent += EntryEvents;
            _text.Justification = Gtk.Justification.Left;
            _text.Anchor = Gtk.AnchorType.NorthWest;
            this.FontModifier = fontModifier;
            _root = group;
            X = _movable ? _graphNode.GlobalPosition.X : _graphNode.Position.X;
            Y = _movable ? _graphNode.GlobalPosition.Y : _graphNode.Position.Y;
            Show ();
        }
Example #10
0
 private void Awake()
 {
     this.canvasGroup = GetComponent <CanvasGroup>();
     this.IsOpen      = false;
 }
Example #11
0
 /// <summary>
 /// 界面栈初始化的时候被调用的方法
 /// </summary>
 /// <param name="param">需要传进来的参数</param>
 public virtual void OnEnter(object param = null)
 {
     _canvasGroup = GetComponent <CanvasGroup>();
     OnShow(param);
 }
Example #12
0
 void ShowUI(CanvasGroup can)
 {
     can.alpha          = 1f;
     can.blocksRaycasts = true;
 }
Example #13
0
 // Use this for initialization
 void Start()
 {
     my_group = GetComponent <CanvasGroup> ();
 }
Example #14
0
 public UMLWidget(CanvasGroup group)
     : base(group)
 {
     InitializeRoot ();
     CanvasEvent += TriggerEvents;
 }
Example #15
0
 // Use this for initialization
 void Start()
 {
     cg = GetComponent <CanvasGroup>();
     StartCoroutine(DoIntro());
 }
Example #16
0
 public Tween FadeOut(CanvasGroup cg)
 {
     cg.DOKill();
     cg.blocksRaycasts = false;
     return(cg.DOFade(0, CANVAS_FADE_TIME));
 }
Example #17
0
        //---------------------------------------------------------------------
        // Messages
        //---------------------------------------------------------------------

        private void Awake()
        {
            _snackbarCanvasGroup = _snackbar.GetComponent <CanvasGroup>();
        }
 // Use this for initialization
 void Start()
 {
     canvasGroup = GetComponent <CanvasGroup>();
     fadeIn      = true;
 }
Example #19
0
 public Tween FadeIn(CanvasGroup cg)
 {
     cg.DOKill();
     cg.blocksRaycasts = true;
     return(cg.DOFade(1, CANVAS_FADE_TIME));
 }
Example #20
0
 private void Awake() => _group = GetComponent <CanvasGroup>();
Example #21
0
 void Awake()
 {
     cg = GetComponent <CanvasGroup>();
 }
Example #22
0
 void Start()
 {
     m_CurrentCanvas = m_CanvasList[m_CurrentCanvasID];
 }
Example #23
0
		private void InitFrontGroup ()
		{
			_front_group = new CanvasGroup (_canvas.Root ());
			_front_group.X = 0;
			_front_group.Y = 0;
		}
        /// <summary>
        /// Creates the list and it's options.
        /// </summary>
        protected void CreateList()
        {
            // Reset the last list size
            this.m_LastListSize = Vector2.zero;

            // Clear the option texts list
            this.m_OptionObjects.Clear();

            // Create the list game object with the necessary components
            this.m_ListObject = new GameObject("UISelectField - List", typeof(RectTransform));

            // Change the parent of the list
            this.m_ListObject.transform.SetParent(this.transform, false);

            // Get the select field list component
            UISelectField_List listComp = this.m_ListObject.AddComponent <UISelectField_List>();

            // Get the list canvas group component
            this.m_ListCanvasGroup = this.m_ListObject.AddComponent <CanvasGroup>();

            // Change the anchor and pivot of the list
            RectTransform rect = (this.m_ListObject.transform as RectTransform);

            rect.anchorMin = Vector2.zero;
            rect.anchorMax = Vector2.zero;
            rect.pivot     = new Vector2(0f, 1f);

            // Prepare the position of the list
            rect.anchoredPosition = new Vector3((float)this.listMargins.left, ((float)this.listMargins.top * -1f), 0f);

            // Prepare the width of the list
            rect.sizeDelta = new Vector2((this.targetGraphic.rectTransform.sizeDelta.x - (this.listMargins.left + this.listMargins.right)), 0f);

            // Hook the Dimensions Change event
            listComp.onDimensionsChange.AddListener(ListDimensionsChanged);

            // Apply the background sprite
            Image image = this.m_ListObject.AddComponent <Image>();

            if (this.listBackgroundSprite != null)
            {
                image.sprite = this.listBackgroundSprite;
            }
            image.type  = this.listBackgroundSpriteType;
            image.color = this.listBackgroundColor;

            // Prepare the vertical layout group
            VerticalLayoutGroup layoutGroup = this.m_ListObject.AddComponent <VerticalLayoutGroup>();

            layoutGroup.padding = this.listPadding;
            layoutGroup.spacing = this.listSpacing;

            // Prepare the content size fitter
            ContentSizeFitter fitter = this.m_ListObject.AddComponent <ContentSizeFitter>();

            fitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize;

            // Get the list toggle group
            ToggleGroup toggleGroup = this.m_ListObject.AddComponent <ToggleGroup>();

            // Create the options
            for (int i = 0; i < this.options.Count; i++)
            {
                // Create the option
                this.CreateOption(i, toggleGroup);

                // Create a separator if this is not the last option
                if (i < (this.options.Count - 1))
                {
                    this.CreateSeparator(i);
                }
            }

            // Prepare the list for the animation
            if (this.listAnimationType == ListAnimationType.None || this.listAnimationType == ListAnimationType.Fade)
            {
                // Starting alpha should be zero
                this.m_ListCanvasGroup.alpha = 0f;
            }
            else if (this.listAnimationType == ListAnimationType.Animation)
            {
                // Attach animator component
                Animator animator = this.m_ListObject.AddComponent <Animator>();

                // Set the animator controller
                animator.runtimeAnimatorController = this.listAnimatorController;

                // Set the animation triggers so we can use them to detect when animations finish
                listComp.SetTriggers(this.listAnimationOpenTrigger, this.listAnimationCloseTrigger);

                // Hook a callback on the finish event
                listComp.onAnimationFinish.AddListener(OnListAnimationFinish);
            }
        }
Example #25
0
 private void Awake()
 {
     rectTransform = GetComponent <RectTransform>();
     canvasGroup   = GetComponent <CanvasGroup>();
 }
Example #26
0
        private void AlphaFadeList(float duration, float alpha)
        {
            CanvasGroup group = m_Dropdown.GetComponent <CanvasGroup>();

            AlphaFadeList(duration, group.alpha, alpha);
        }
 void HideUI(CanvasGroup canvasGroup)
 {
     canvasGroup.alpha          = 0f;    //this makes everything transparent
     canvasGroup.blocksRaycasts = false; //this prevents the UI element to receive input events
 }
 public static void Hide(this CanvasGroup mcanvasGroup)
 {
     MHide(mcanvasGroup);
 }
Example #29
0
 void hideUI(CanvasGroup can)
 {
     can.alpha          = 0f;
     can.blocksRaycasts = false;
 }
 private static void MShow(this CanvasGroup mcanvasGroup)
 {
     mcanvasGroup.alpha          = 1;
     mcanvasGroup.interactable   = true;
     mcanvasGroup.blocksRaycasts = true;
 }
Example #31
0
    IEnumerator randHelper()
    {
        if (dm.cpa == null)
        {
            dm.callSwitch();
            yield return(null);
        }
        yield return(null);

        while (dm.cpa == null)
        {
            yield return(null);
        }
        while (dm.load.loaddd)
        {
            yield return(null);
        }


        if (dm.cpa != null)
        {
            dm.cpa.gameObject.SetActive(false);
        }
        int length = UnityEngine.Random.Range(0, itemType.GetNames(typeof(itemType)).Length - 10);

        length /= 2;
        HashSet <int> enums = new HashSet <int>();

        enums.Add((int)itemType.ebrow);
        enums.Add((int)itemType.bh_air);
        enums.Add((int)itemType.b_ngs);
        enums.Add((int)itemType.e_ye);
        enums.Add((int)itemType.bg);
        enums.Add((int)itemType.t_clothes);
        for (int i = 0; i < length; i++)
        {
            enums.Add(UnityEngine.Random.Range(5, (int)itemType.particle_snow));
        }
        enums.Add((int)itemType.skin);

        /*
         * bugs:
         * cpa not loaded in time
         *
         * randomize
         *
         *
         *  test save/load
         *
         */

        List <UndoInfo> uiArr = new List <UndoInfo>();

        itemType[][] BadMatches = new itemType[][] {
            new itemType[] { itemType.msk, itemType.b0odnos, itemType.bood, itemType.JBandage, itemType.lippiercing, itemType.bubble },
            new itemType[] { itemType.bood, itemType.starfreckles },
            new itemType[] { itemType.BOW, itemType.chneckwear },
            new itemType[] { itemType.bronzer, itemType.UEye },
            new itemType[] { itemType.glasses, itemType.EPatch, itemType.scar },
            new itemType[] { itemType.harts, itemType.flower },
            new itemType[] { itemType.freckles, itemType.starfreckles, itemType.bDaid },
            new itemType[] { itemType.hesidehorn, itemType.unicorn, itemType.eear, itemType.flower },
        };

        foreach (itemType[] iList in BadMatches)
        {
            itemType i1 = iList[0];

            foreach (itemType i2 in iList)
            {
                if (enums.Contains((int)i1) && enums.Contains((int)i2))
                {
                    enums.Remove((UnityEngine.Random.value > 0.5f) ? (int)i1 : (int)i2);
                }
            }
        }


        Color bg = dm.fm.bg.color;

        HashSet <string> s = new HashSet <string>(new string[] {
            "b_", "ir", "w_", "ey", "bh", "e_", "eb", "l_", "n_", "bg", "BY", "CH", "HD", "t_",
        });
        Button check = dm.cpa.transform.parent.GetChild(1).GetComponent <Button>();

        check.onClick.RemoveAllListeners();

        foreach (var i in Enum.GetValues(typeof(itemType)))
        {
            itemType it   = (itemType)i;
            Sprite   newT = getRandomSprite(it);
            string   key  = it.ToString().Substring(0, 2);

            if (newT != null && !s.Contains(key) && dm.fm.XtraStuff.ContainsKey(key))
            {
                if (dm.fm.XtraStuff[key] != null)
                {
                    dm.fm.XtraStuff[key].gameObject.SetActive(false);
                    //make remove undoable
                    if (dm.fm.XtraStuff.ContainsKey(key + "2"))
                    {
                        dm.fm.XtraStuff[key + "2"].gameObject.SetActive(false);
                        dm.x.onClick.AddListener(() =>
                        {
                            dm.fm.XtraStuff[key].gameObject.SetActive(true);
                            dm.fm.XtraStuff[key + "2"].gameObject.SetActive(true);
                        });
                    }
                    else
                    {
                        dm.x.onClick.AddListener(() =>
                        {
                            dm.fm.XtraStuff[key].gameObject.SetActive(true);
                        });
                    }


                    check.onClick.AddListener(() =>
                    {
                        dm.fm.Remove(key);
                    });
                }
            }
            else if (enums.Contains((int)i))
            {
                uiArr.Add(dm.fm.faceSet(newT, it));
                //if heart..
                if (it == itemType.harts && GameObject.FindGameObjectWithTag("Finish").transform.Find("hartic") == null)
                {
                    dm.setUpParticles(dm.xtra[16], 1, Color.white, true);
                }
                // else if (it == itemType.particles) dm.setUpParticles(uiArr[count].before, 0);
            }
        }

        dm.colorPick(uiArr);
        randomizeParams(dm.fm, dm.x);
        yield return(null);

        CanvasGroup cp = dm.cpa.transform.root.GetComponent <CanvasGroup>();

        check.onClick.AddListener(() => { dm.TurnOffEnd(cp); });
        dm.x.onClick.AddListener(() => { check.onClick.RemoveAllListeners(); check.onClick.AddListener(() => dm.TurnOffEnd(cp)); });
        RandomizeColors(uiArr, bg);
    }
Example #32
0
 // Start is called before the first frame update
 void Start()
 {
     canvasGroup = GetComponent <CanvasGroup>();
     StartCoroutine(FadeOutCoroutine());
 }
Example #33
0
    public CUIManager(CToolkitUI Toolkit, CGameUIStyle Style)
    {
        _ui    = Toolkit;
        _style = Style;
        _uiRes = CGame.UIResources;

        mPoseRT = new RenderTexture(512, 512, 24, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
        mPoseRT.antiAliasing = 8;

        gameUI = _ui.CreateElement(_ui.Canvas, "gameUI");
        _ui.SetRectFillParent(gameUI);
        gameUI.transform.SetAsFirstSibling();

        underlayLayer = _ui.CreateElement(gameUI, "underlayLayer");
        _ui.SetRectFillParent(underlayLayer);

        CanvasGroup cgroup = underlayLayer.AddComponent <CanvasGroup>();

        cgroup.blocksRaycasts = false;

        primaryLayer             = _ui.CreateElement(gameUI, "primaryLayer");
        mPrimaryLayerGroup       = primaryLayer.AddComponent <CanvasGroup>();
        mPrimaryLayerGroup.alpha = 1.0f;
        _ui.SetRectFillParent(primaryLayer);

        overlayLayer = _ui.CreateElement(gameUI, "overlayLayer");
        _ui.SetRectFillParent(overlayLayer);

        cgroup = overlayLayer.AddComponent <CanvasGroup>();
        cgroup.blocksRaycasts = false;

        cutsceneLayer = _ui.CreateElement(gameUI, "cutsceneLayer");
        _ui.SetRectFillParent(cutsceneLayer);
        GameObject letterBox = _ui.CreateElement(cutsceneLayer);

        _ui.SetAnchors(letterBox, new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 1));
        _ui.AddImage(letterBox, _style.ThemeColorC);
        _ui.SetTransform(letterBox, 0, 0, 0, 54);

        letterBox = _ui.CreateElement(cutsceneLayer);
        _ui.SetAnchors(letterBox, new Vector2(0, 0), new Vector2(1, 0), new Vector2(0, 0));
        _ui.AddImage(letterBox, _style.ThemeColorC);
        _ui.SetTransform(letterBox, 0, 0, 0, 54);

        mCutsceneLayerGroup                = cutsceneLayer.AddComponent <CanvasGroup>();
        mCutsceneLayerGroup.alpha          = 0.0f;
        mCutsceneLayerGroup.blocksRaycasts = false;

        /*
         * fadeOverLayer = _ui.CreateElement(gameUI, "fadeOverLayer");
         * _ui.SetRectFillParent(fadeOverLayer);
         * _ui.AddImage(fadeOverLayer, Color.black);
         */

        contextMenuLayer = _ui.CreateElement(gameUI, "contextMenuLayer");
        _ui.SetRectFillParent(contextMenuLayer);

        mMenuLayer = _ui.CreateElement(gameUI, "menuLayer");
        _ui.SetRectFillParent(mMenuLayer);

        GameObject productText = _ui.CreateTextElement(overlayLayer, CGame.PRODUCT_NAME + " (" + CGame.VERSION_MAJOR + "." + CGame.VERSION_MINOR + ") " + CGame.VERSION_NAME, "productText", CToolkitUI.ETextStyle.TS_HEADING);

        _ui.SetAnchors(productText, new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, 1));
        _ui.SetTransform(productText, 5, 0, -10, 20);
        productText.GetComponent <Text>().alignment = TextAnchor.MiddleRight;

        mContextMenu = new CContextMenu(Toolkit, Style, contextMenuLayer);
        mTooltip     = new CTooltip(Toolkit, Style, overlayLayer);

        SetupForGameSession();
    }
 // Use this for initialization
 void Start()
 {
     Instance      = this;
     topoTreeGroup = topoTree.transform.GetComponent <CanvasGroup>();
 }
Example #35
0
 private void Awake()
 {
     grupo = GetComponent <CanvasGroup>();
 }
Example #36
0
	public BoardPiece (CanvasGroup group, BoardPiece [] board, int x, int y, int i)
		: base (group, CanvasGroup.GType)
	{
		this.X = (x * PIECE_SIZE);
		this.Y = (y * PIECE_SIZE);
		this.Board = board;
		this.Number = i;
		this.Position = i;		

		CanvasRect rect = new CanvasRect (this);
		rect.X1 = 0.0;
		rect.Y2 = 0.0;
		rect.X2 = PIECE_SIZE;
		rect.Y2 = PIECE_SIZE;
		rect.FillColor = Color;
		rect.OutlineColor = "black";
		rect.WidthPixels = 0;
		
		CanvasText text = new CanvasText (this);
		text.Text = (i + 1).ToString ();
		text.X = PIECE_SIZE / 2.0;
		text.Y = PIECE_SIZE / 2.0;
		text.Font = "Sans Bold 24";
		text.Anchor = AnchorType.Center;
		text.FillColor = "black";

		this.Text = text;
		this.CanvasEvent += new Gnome.CanvasEventHandler (Piece_Event);
	}
Example #37
0
        public UMLEntry(
			UMLElement owner,
			DI.GraphNode graphNode,
			CanvasGroup group,
			bool isMovable,
			string text
		)
            : this(owner, graphNode, group, isMovable, text, null)
        {
        }
Example #38
0
 public static void Show(this CanvasGroup cg, bool value)
 {
     cg.alpha          = value.ToInt();
     cg.interactable   = value;
     cg.blocksRaycasts = value;
 }
Example #39
0
		private void InitBackGroup ()
		{
			_back_group = new CanvasGroup (_canvas.Root ());
			_back_group.X = 0;
			_back_group.Y = 0;
			
			//Nicer appearence with a drawn background
			_bg = new CanvasRect (_back_group);
			_bg.X1 = _bg.Y1 = 0;
			/*_bg.X2 = _canvas.Width;
			_bg.Y2 = _canvas.Height;*/
			_bg.FillColor = DEFAULT_FILL_COLOR;

			_grid = false;
			_snap_to_grid = false;

			_grid_components = new ArrayList ();
		}
Example #40
0
 public void SetCanvasFadeReference(CanvasGroup fadecanvas)
 {
     this.fadecanvas = fadecanvas;
 }
 private static void MHide(this CanvasGroup mcanvasGroup)
 {
     mcanvasGroup.alpha          = 0;
     mcanvasGroup.interactable   = false;
     mcanvasGroup.blocksRaycasts = false;
 }
Example #42
0
 /// <summary>
 /// Prepare the RectTransform to fit the Slot properly.</summary>
 void Awake()
 {
     _rect        = GetComponent <RectTransform>();
     _canvasGroup = GetComponent <CanvasGroup>();
     FitIntoSlot();
 }
Example #43
0
 public MyBPath(CanvasGroup cg)
     : base(cg)
 {
 }
 public static void Show(this CanvasGroup mcanvasGroup)
 {
     MShow(mcanvasGroup);
 }
Example #45
0
 protected UMLEdgeEnd(CanvasGroup group)
     : base(group)
 {
 }
Example #46
0
 void Awake()
 {
     theRectTransform = screenSpace.GetComponent <RectTransform>();
     theCanvasGroup   = screenSpace.GetComponent <CanvasGroup>();
     screenDimensions = new Vector2(Screen.width, Screen.height);
 }