コード例 #1
0
ファイル: GUIDemoContent.cs プロジェクト: zcyemi/Rigel.EGUI
        private void SampleDragDrop(RigelGUIEvent e)
        {
            //DragRect/DropRect
            {
                GUILayout.DragRect("contract1", new Vector2(50, 20), "AAA");
                GUILayout.DragRect("contract2", new Vector2(50, 20), "BBB");
                //GUILayout.DropRect(new Vector2(100, 50), "contract1", (o) =>
                //{
                //    Console.WriteLine("OnDrop " + o);
                //}, () =>
                //{
                //    GUILayout.Label("contract1:OnHover");
                //});
                //GUILayout.DropRect(new Vector2(100, 50), "contract2", (o) =>
                //{
                //    Console.WriteLine("OnDrop " + o);
                //}, () =>
                //{
                //    GUILayout.Label("contract2:OnHover");
                //});
            }

            {
                GUILayout.Space(5);

                var offset = GUI.CurLayout.Offset;
                var rect   = new Vector4(offset, 300, 23);
            }

            {
                var rect   = new Vector4(GUI.CurLayout.Offset, 200, 25);
                var rectab = GUI.GetAbsoluteRect(rect);
                GUI.ReorderedListAbsolute(sortedList, rectab);

                rectab.y += 30;
                rectab.z  = 120;
                rectab.w  = 100;
                GUI.ReorderedListVerticalAbsolute(sortedList, rectab);
            }
        }