Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Access Violations at setting width/height? x.x (https://forums.graalonline.com/forums/showthread.php?t=80056)

projectigi 06-12-2008 05:42 PM

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?

cbk1994 06-12-2008 05:44 PM

You really need to style your code. It is very hard to understand. Can you explain a bit what you are trying to do?

projectigi 06-12-2008 05:48 PM

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

cbk1994 06-12-2008 06:06 PM

Quote:

Originally Posted by projectigi (Post 1396528)
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?

projectigi 06-12-2008 06:28 PM

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 :D

cbk1994 06-12-2008 08:00 PM

Quote:

Originally Posted by projectigi (Post 1396548)
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 :D

I think with getTextWidth() you can set the font size, etc.

projectigi 06-12-2008 08:05 PM

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


All times are GMT +2. The time now is 01:56 PM.

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