Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-12-2008, 05:42 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Access Violations at setting width/height? x.x

Hi,

PHP Code:
  if( GUI_tooltipCtrl.objectType() != "asdf" GUI_tooltipCtrl.destroy();
  
GUI_tooltipCtrl.destroy();
  new 
GuiScrollCtrl"GUI_tooltipCtrl" );
  
GUI_tooltipCtrl.500;
  
GUI_tooltipCtrl.50;
  
GUI_tooltipCtrl.visible true;
  
GUI_tooltipCtrl.profile GuiScrollProfile;  
  
GUI_tooltipCtrl.minsize = {00};
  
GUI_tooltipCtrl.useownprofile true;
  
GUI_tooltipCtrl.profile.bitmap "";  
  
GUI_tooltipCtrl.profile.fillcolor = { 30.635.725.5204 };    
  
GUI_tooltipCtrl.profile.bordercolor = { 200200200255 };  
  
GUI_tooltipCtrl.vScrollBar "alwaysOff";
  
GUI_tooltipCtrl.hScrollBar "alwaysOff";  
  
this.tooltipCtrl.profile.fillcolorhl this.tooltipCtrl.profile.fillcolor;
  
this.tooltipCtrl.profile.fillcolorna this.tooltipCtrl.profile.fillcolor;  
  
this.tooltipCtrl.profile.bordercolorna this.tooltipCtrl.profile.bordercolor;    
  
this.tooltipCtrl.profile.bordercolorhl this.tooltipCtrl.profile.bordercolor;      
  
GUI_tooltipCtrl.profile.border 1;  
  
GUI_tooltipCtrl.profile.transparency 1;  
  if( 
GUI_tooltipCtrl_Text.objectType() != "GuiMLTextCtrl" )  GUI_tooltipCtrl_Text.destroy();
  
withGUI_tooltipCtrl ) new GuiMLTextCtrl"GUI_tooltipCtrl_Text" );
  
GUI_tooltipCtrl.text "testing this stuff";
  
GUI_tooltipCtrl.profile GuiMLTextProfile;
  
GUI_tooltipCtrl.width GUI_tooltipCtrl_Text.width;
  
GUI_tooltipCtrl.height GUI_tooltipCtrl_Text.height;  
 
// GUI_tooltipCtrl.width = GUI_tooltipCtrl_Text.width;
//  GUI_tooltipCtrl.height = GUI_tooltipCtrl_Text.height; 
  
GUIContainer.addControlGUI_tooltipCtrl ); 
If i remove the // from
PHP Code:
 // GUI_tooltipCtrl.width = GUI_tooltipCtrl_Text.width;
//  GUI_tooltipCtrl.height = GUI_tooltipCtrl_Text.height; 
I get access violations... any ideas?
__________________
Reply With Quote
  #2  
Old 06-12-2008, 05:44 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You really need to style your code. It is very hard to understand. Can you explain a bit what you are trying to do?
__________________
Reply With Quote
  #3  
Old 06-12-2008, 05:48 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
actually its styled? o.o
if you mean commenting then

having a guiscrollctrl with a text inside
the guiscrollctrl should be wide enough to show all of the text but maximum 200 px, if the text is longer it should be wrapped

so i'm trying to set the guiscrollctrl size to the mltextctrlsize
__________________
Reply With Quote
  #4  
Old 06-12-2008, 06:06 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by projectigi View Post
actually its styled? o.o
Then, the way you have it set up makes it very hard to read.
Quote:
if you mean commenting then

having a guiscrollctrl with a text inside
the guiscrollctrl should be wide enough to show all of the text but maximum 200 px, if the text is longer it should be wrapped

so i'm trying to set the guiscrollctrl size to the mltextctrlsize
Maybe try something like gettextwidth() to get the text width, and then use that to calculate the size?
__________________
Reply With Quote
  #5  
Old 06-12-2008, 06:28 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
getTextWidth uses the Tags too prob is too that when you change font size etc with tags, getTextWidth doesnt recognize that

i had a system that worked fine, but polys/imgs cant be over guictrls, so i'm trying to move it to guictrl
__________________

Last edited by projectigi; 06-12-2008 at 06:39 PM..
Reply With Quote
  #6  
Old 06-12-2008, 08:00 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by projectigi View Post
getTextWidth uses the Tags too prob is too that when you change font size etc with tags, getTextWidth doesnt recognize that

i had a system that worked fine, but polys/imgs cant be over guictrls, so i'm trying to move it to guictrl
I think with getTextWidth() you can set the font size, etc.
__________________
Reply With Quote
  #7  
Old 06-12-2008, 08:05 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
well, yeah but it doesnt auto-recognize the font-size etc
so if someone uses tags to change the font size it will

a) read the tags as text, thus having a longer text than needed
b) not recognize the changed font size, thus having a smaller text size than it actually is
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:07 AM.


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