Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUI Control canMove not working. (https://forums.graalonline.com/forums/showthread.php?t=134262989)

Devil_Lord2 04-26-2011 11:55 PM

GUI Control canMove not working.
 
Scripting Level = Beginner "always"
Code isn't the whole script because obviously it isn't finished.

Everything is under onCreated for testing purposes.

So, I'm not too bad at GUI's and ZeroG wanted me to make one for the server. Basically wanted a window with tabs.. now I could have put the tabs on a guiwindowctrl, but then I would have the tab under the bad top window spot.. and the minimize, close, and such buttons...

So, I was thinking I could recreate a 'window' so to speak, with the tabs above it and have it moveable.. technically what I have could work not moveable.. Anyway... let's get to the point.

Main Problem: canMove does not work for the outside container holding the third guicontrol, and tabs.. however the third guicontrol could move with it on... this is odd to me.. I've even tried to move it outside of the tab and third guicontrol clicking in the second's box.

Second GuiControl won't move.

Sub Problem: profile.fillcolor and fillcolor isn't working, not too important.

Anyone know why the second window isn't moving the two things it is containing? Yet the third would? I tried putting canMove on the two as well because I thought they would be holding it down.. but that was a stupid thought. :]

Or, is there a window without the top bar that I could use instead?
I'd love to figure this out, because I'd like to make a GUI tutorial.
I don't find wikia or bible that helpful for many of the tutorials or information... I'd like to make tutorials for new people, not people who know what to do... GUI's I feel semi confident in making a tutorial for.. other scripting I do not.

PHP Code:

findplayer("Devil_Lord2").addweapon(this.name);

//#CLIENTSIDE
function onCreated(){   
    new 
GuiControl("Frontier_MainMenuCtrl"){  //Invisible Controller Box
      
position = {screenheight/2-300screenwidth/2};
      
extent   "600, 600";
      
      new 
GuiControl("Frontier_MainMenu"){    //Invisible Compact Box
        
useownprofile true;
        
fillColor = {25500};
        
position = {55,0};
        
extent   "300, 300";
        
text     "Main Menu";
        
canMove  true;        // This I want to work, but does not.
        
visible  true
        
        new 
GuiControl("Frontier_MainBox"){  //Invisible Box will hold text.
          
profile.fillcolor = {250,250,250,.8};
          
useownprofile true;
          
profile.border 3;
          
position = {1,30};
          
extent   "300, 270";
          
text     "Main Menu";
          
//canMove = true;     // This does work
        
}  
        
        new 
GuiTabCtrl("Frontier_MainTabs"){  //Tabs above the text box.
          
position "1,0";
          
extent   "400,30";
          
tabwidth =  55;
          
          
clearrows();
          
addrow(0,"Help");
          
addrow(1,"Quest");
          
addrow(2,"Credits");
          
setSelectedRow(0);
        }       
      }    
   }



fowlplay4 04-27-2011 12:41 AM

When you click it, Frontier_MainBox receives the click instead of the control under it (Frontier_MainMenu). You can make it "click-throughable" by doing...

PHP Code:

useownprofile true;
profile.modal false

Source:
http://forums.graalonline.com/forums...96&postcount=9

Mark Sir Link 04-27-2011 12:46 AM

for your other problem, move the fillcolor change to below where you change useownprofile = true;

ex:
PHP Code:

useownprofile true;
profile.fillcolor = {rgba}; 


Devil_Lord2 04-27-2011 03:24 AM

Unsure what the modal part does, but I tried it, and moved the fillcolor to the bottom.. both did not work D:

I might end up putting everything in a GuiWindowCtrl anyway. >.>
I can't seem to understand why the one GuiControl could move, and the other cannot, besides the point one is the host of two other things.. Evil..

I appreciate both of your help, so far still not working however.

Mark Sir Link 04-27-2011 03:56 AM

you may need a border around the GUIControl for it to be moved

Devil_Lord2 04-27-2011 04:29 AM

:o I will try that again! With the newly added things.

-edit- Nope D: and I put that below useownprofile..

>:O The thing just hates me..


All times are GMT +2. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.