Results 1 to 2 of 2
  1. #1
    AlexGeoZz1's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    137
    Reputation
    10
    Thanks
    827

    Making My GUI drag-able (Or certain features)

    I want to make my GUI for the item spawner list into a window and dragable like lick hack, but I cannot get it working It would be great if you could help, then I can release my menu!

    The source I need to make dragable window into:
    Code:
    this.scrollPosition = GUI.BeginScrollView(new Rect((this.scrWidth / 2f) - (0f), 100f, 206f, 170f), this.scrollPosition, new Rect(0f, 0f, 206f, 10000f));
                int num = 1;
                foreach (int num2 in this.itemIdList)
                {
                    this.itemSpawnButton(num2, num * 30);
                    num++;
                }
    Code:
        void itemSpawnButton(int itemid, int y)
        {
    
            if (GUI.Button(new Rect(0f, (float)y, 180f, 30f), ItemName.getName(itemid)))
            {
                SpawnItems.spawnItem(itemid, 1, Camera.main.transform.position);
            }
    
        }
    Im not asking for you to do it for me as I know thats just spoon feeding, All I need is to be pointed in the right direction. Im pretty sure the code needs to be changed a bit for it to work but im not experienced at all with C#

  2. #2
    LordNature's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    158
    Reputation
    10
    Thanks
    1,171
    My Mood
    Amazed
    Quote Originally Posted by zths View Post
    don't make you hack path has special characters(like chinese) or space。
    if not game well crash wen you inject。


    public class Hack : MonoBehaviour
    {
    //Rect of window size and postion
    private static Rect nickwindow = new Rect(Helper.scrWidth / 2f - 300f, 0f, 300f, 130f);

    private void OnGUI()
    {
    //draw window
    int windowid = 0;
    nickwindow = GUI.Window(windowid++, nickwindow, nickchange, new GUIContent("- window title -"));
    }

    private static void nickchange(int winid)
    {
    GUI.skin.label.fontSize = 12;
    float pos = 0;
    GUI.Label(new Rect(0f, (pos += 25f), 300f, 25f), "你的真實Steam暱稱:");

    // make window dragable
    GUI.DragWindow();
    }
    }
    Some source by zths. Look at the GUI.DragWindow(); part.

  3. The Following User Says Thank You to LordNature For This Useful Post:

    AlexGeoZz1 (08-02-2014)

Similar Threads

  1. [Info] [NEW]HOW TO MAKE YOUR CE BE ABLE TO SCAN!
    By loped in forum Mission Against Terror Discussions
    Replies: 4
    Last Post: 10-26-2012, 11:59 PM
  2. C++ need to make hack that only has text no features :(
    By Falco1337 in forum Combat Arms Coding Help & Discussion
    Replies: 0
    Last Post: 03-30-2012, 08:04 PM
  3. [Help]Make A Macro Focus on a Certain window
    By death12236 in forum Suggestions, Requests & General Help
    Replies: 0
    Last Post: 07-28-2010, 11:19 AM
  4. How can I make my GUI look better?
    By g0t5k111z2 in forum Visual Basic Programming
    Replies: 6
    Last Post: 07-06-2010, 02:15 PM
  5. How to make a GUI (.exe) trainer using cheat engine
    By iJustHelp in forum Call of Duty Modern Warfare 2 Tutorials
    Replies: 8
    Last Post: 05-01-2010, 06:32 PM