public void RegisterTexture(string name, LMS_Txt txt)
    {
        Texture2D tex;

        LMS_GuiTexureLoader.LoadTexture(txt.GetRawText(), out tex);
        LMS_Textures.AddCache(name, tex);
    }
예제 #2
0
    /* @RENDER ORDER!
     * 1 LABEL
     * 2 BUTTON
     * 3 BOX
     */

    void Awake()
    {
        InitLabels();
        InitButtons();
        InitOverlays();
        Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
        {
            Rect = new Rect(100f, 100f, 800f, 500f)
        }, 2000, null);
        Owner.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("MAIN_MENU_TEX"));
        Owner.primary   = true;
        Owner.Draggable = true;
        Owner.AddChild(AutomationLabel);
        Owner.AddChild(EspLabel);
        Owner.AddChild(Automation);
        Owner.AddChild(Esp);
        Owner.AddChild(Creditslabel);
        Owner.AddChild(CopsLogo);
        Owner.AddChild(Misc);
        Owner.AddChild(MiscLabel);
        Owner.AddChild(OptionsWindow);
        Owner.AddChild(Version);
        Owner.AddChild(MovementLabel);
        Owner.AddChild(Movement);
        Owner.AddChild(Fun);
        Owner.AddChild(FunLabel);
        Owner.AddChild(GUIEditor);
        Owner.AddChild(GUIEditorLabel);
        Owner.AddChild(Updater);
        Owner.AddChild(UpdaterLabel);
        Owner.AddChild(Credits);
        Owner.AddChild(_CreditsLabel);
        Owner.AddChild(OptTitle);
        Owner.AddChild(OptText);
    }
예제 #3
0
 void Awake()
 {
     InitLabels();
     InitButtons();
     InitOverlays();
     Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
     {
         Rect = new Rect(Screen.width / 2 - 400f, Screen.height / 2 - 250f, 800f, 500f)
     }, 20000, null);
     Owner.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("AUTH_BACK_TEX"));
     Owner.primary   = true;
     Owner.Draggable = true;
     Owner.AddChild(Title);
     Owner.AddChild(SubTitle);
     Owner.AddChild(UserLabel);
     Owner.AddChild(PassLabel);
     Owner.AddChild(UserTextFieldRenderer);
     Owner.AddChild(PassTextFieldRenderer);
     Owner.AddChild(UserTextField);
     Owner.AddChild(PassTextField);
     Owner.AddChild(LoginButton);
     Owner.AddChild(LoginButtonLabel);
     Owner.AddChild(PurchaseButton);
     Owner.AddChild(PurchaseButtonLabel);
 }
 void Awake()
 {
     InitLabels();
     InitToggles();
     InitOverlays();
     InitButtons();
     InitScrollers();
     Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig
     {
         Rect = new Rect(100f, 100f, 800f, 500f)
     }, 20000, null);
     Owner.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("MAIN_MENU_TEX"));
     Owner.primary   = true;
     Owner.Draggable = true;
     Owner.AddChild(Creditslabel);
     Owner.AddChild(CopsLogo);
     Owner.AddChild(OptionsWindow);
     Owner.AddChild(Version);
     Owner.AddChild(OptTitle);
     Owner.AddChild(OptText);
     Owner.AddChild(Weapon);
     Owner.AddChild(ScreenB);
     Owner.AddChild(Camera);
     Owner.AddChild(Player);
     Owner.AddChild(msGUI);
     Owner.AddChild(WeaponLabel);
     Owner.AddChild(ScreenLabel);
     Owner.AddChild(CameraLabel);
     Owner.AddChild(PlayerLabel);
     Owner.AddChild(msGUILabel);
     Owner.AddChild(OptWeaponScroller);
     Owner.AddChild(OptInvisibleWeaponLabel);
     Owner.AddChild(OptInvisibleWeaponToggleLabel);
 }
 void InitOverlays()
 {
     CopsLogo = InstantiateChild <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
     {
         Rect = new Rect(339f, 47f, 413f, 233f)
     }, 1000000);
     CopsLogo.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("COPS_LOGO_TEX"));
     OptionsWindow = InstantiateChild <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
     {
         Rect = new Rect(163f, 12f, 445f, 484f)
     }, 2000000);
     OptionsWindow.SetTexture((int)E_Texture.IDLE, OptionsWindow.GeneratePlainTexture(Color.black.AlterAlpha(206f / 255f)));
     TouchBar = InstantiateChild <LMS_GuiBaseTouchBar>(new LMS_GuiConfig()
     {
         Rect = new Rect(0f, 0f, Screen.width, Screen.height)
     }, 3000000);
     TouchBar.SetTexture((int)E_Texture.IDLE, OptionsWindow.GeneratePlainTexture(Color.clear));
     TouchBar.onSwipe += (swipe) =>
     {
         if (Owner.Down)
         {
             return;
         }
         if (swipe == E_Swipe.DOWN)
         {
             if (selectedIndex + 1 == SelectionIndex.Count)
             {
                 selectedIndex = 0;
             }
             else
             {
                 selectedIndex++;
             }
         }
         else if (swipe == E_Swipe.UP)
         {
             if (selectedIndex - 1 == -1)
             {
                 selectedIndex = SelectionIndex.Count - 1;
             }
             else
             {
                 selectedIndex--;
             }
         }
         else
         {
             if (SelectionIndex.Keys.Count == 0)
             {
                 return;
             }
             LMS_GuiBaseButton b = SelectionIndex[selectedIndex].Value;
             if (b.OnClick != null)
             {
                 b.OnClick();
             }
         }
     };
 }
예제 #6
0
 void Awake()
 {
     InitLabels();
     InitButtons();
     Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
     {
         Rect = new Rect(Screen.width / 2 - 300f, Screen.height / 2 - 200f, 600f, 400f)
     }, 20000, null);
     Owner.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("AUTH_BACK_TEX"));
     Owner.primary   = true;
     Owner.Draggable = true;
     Owner.AddChild(Title);
     Owner.AddChild(Text);
     Owner.AddChild(Ok);
     Owner.AddChild(OkLabel);
 }
예제 #7
0
    void InitButtonDefault(LMS_GuiBaseButton b, string text, string title, LMS_GuiBaseButton.ClickCallbackDelegate onClick = null)
    {
        b.SetTexture((int)E_Texture.DOWN, LMS_Textures.GetCache("BUTTON_TEX"));
        b.SetTexture((int)E_Texture.IDLE, b.GeneratePlainTexture(Color.clear));
        b.BlendMode = E_BlendMode.BLENDED;
        if (onClick != null)
        {
            b.OnClick += onClick;
        }
        LMS_GuiViewSelection sel = new LMS_GuiViewSelection
        {
            Text            = text,
            Title           = title,
            CollectionIndex = SelectionIndex.Values.Count
        };

        SelectionIndex[sel.CollectionIndex] = new KeyValuePair <LMS_GuiView, LMS_GuiBaseButton>(sel, b);
    }
 void Awake()
 {
     InitLabels();
     InitButtons();
     InitOverlays();
     Owner = LMS_GuiBaseUtils.InstantiateGUIElement <LMS_GuiBaseBox2D>(new LMS_GuiConfig()
     {
         Rect = new Rect(0f, 0f, 500f, Screen.height)
     }, 20000, null);
     Owner.SetTexture((int)E_Texture.IDLE, LMS_Textures.GetCache("OVERLAY_BACK_TEX"));
     Owner.primary = true;
     Owner.AddChild(LoggedInAs);
     Msgs.Loop(curr => Owner.AddChild(curr));
     Owner.AddChild(SendButton);
     Owner.AddChild(SendButtonLabel);
     Owner.AddChild(MsgTextField);
     Owner.AddChild(MsgTextFieldRenderer);
 }