Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GuiWindowCtrl & ShowText (https://forums.graalonline.com/forums/showthread.php?t=72186)

projectigi 02-14-2007 05:40 PM

GuiWindowCtrl & ShowText
 
Hi,

i tried the following:

I made a GuiWindowCtrl and made ShowText to display some text on it
well, now the problem is:
the window is actually over the text, so the text is "grayed out"(window is transparent )

any way to fix this?

Chandler 02-14-2007 07:07 PM

I found this problem too, you need to use the new GuiTextCtrl/GuiMLTextCtrl.
Use the visible toggle if you need to display it after an action.

Kristi 02-14-2007 09:48 PM

Showtext displays an image object on the graal level. if you want it in a gui, you need a gui object, as chandler stated.

projectigi 02-14-2007 10:19 PM

yeye, i just think there should be a option to make imgobject > gui
or stefan should add a drawText to GuiDrawingPanel

Kristi 02-14-2007 11:08 PM

Quote:

Originally Posted by projectigi (Post 1277457)
yeye, i just think there should be a option to make imgobject > gui
or stefan should add a drawText to GuiDrawingPanel

umm.. GuiShowImgCtrl, has the properties of an img, its exactly that

projectigi 02-15-2007 06:16 PM

Quote:

Originally Posted by Kristi (Post 1277503)
umm.. GuiShowImgCtrl, has the properties of an img, its exactly that

yeah but thats a gui ctrl not a showtext/image obj

Chandler 02-15-2007 06:24 PM

Quote:

Originally Posted by projectigi (Post 1277949)
yeah but thats a gui ctrl not a showtext/image obj

It's used as the same... you can do anything you wanted to do with showtext//image// with GuiShowImgCtrl/GuiTextCtrl or GuiMLTextCtrl.

projectigi 02-15-2007 06:38 PM

nope

you cant overwrite it by drawing another image of the same index
you cant just say hideimg and its gone

Chandler 02-15-2007 06:43 PM

Quote:

Originally Posted by projectigi (Post 1277953)
nope

you cant overwrite it by drawing another image of the same index
you cant just say hideimg and its gone

You don't know how to edit a gui? [Or name one...?]
You don't know how to destroy a gui profile?

Gambet 02-15-2007 07:56 PM

Quote:

Originally Posted by projectigi (Post 1277953)
nope

you cant overwrite it by drawing another image of the same index
you cant just say hideimg and its gone



You really need to learn about GS2 GUI Controls.

napo_p2p 02-15-2007 08:16 PM

Quote:

Originally Posted by projectigi (Post 1277953)
nope

you cant overwrite it by drawing another image of the same index
you cant just say hideimg and its gone

But if you edit the text/options/position of the object, it will be the same as overwriting.
To get rid of it you can either set visible to false or destroy it. (I recommend the former, especially if you want to use it again).

Admins 02-15-2007 09:25 PM

GuiShowImgCtrl works like a showimg/findimg, only showing/hidding, position and size are defined differently. But you can display everything that can be displayed with a showimg/findimg.

projectigi 02-16-2007 12:17 AM

whoa....

how you get called "stupid" when you just ask for a way to make something without using own functions...

see, i'm just lazy, thats why i like using premade functions instead of making own functions

napo_p2p 02-16-2007 12:31 AM

Quote:

Originally Posted by projectigi (Post 1278046)
whoa....

how you get called "stupid" when you just ask for a way to make something without using own functions...

see, i'm just lazy, thats why i like using premade functions instead of making own functions

Wrong thread?

Kristi 02-16-2007 12:42 AM

Quote:

Originally Posted by projectigi (Post 1278046)
whoa....

how you get called "stupid" when you just ask for a way to make something without using own functions...

see, i'm just lazy, thats why i like using premade functions instead of making own functions

theyre pretty "premade", just use the "premade" function to destroy the gui object :)

xXziroXx 02-16-2007 01:58 AM

GUIOBJECT.destroy()

How hard can it be?

projectigi 02-17-2007 01:22 AM

....
i know how to create/destroy gui controls, thanks.

for example:

a Server wants to show a Text on the Screen that tells you the current Area
like "Online Start Local" "Kokiri Town" etc
now it sucks if you have to make a own guicontrol for every text you ever want to display on the screen, because showtext has no function to make it appear over gui controls

napo_p2p 02-17-2007 02:15 AM

Quote:

Originally Posted by projectigi (Post 1278370)
....
a Server wants to show a Text on the Screen that tells you the current Area
like "Online Start Local" "Kokiri Town" etc
now it sucks if you have to make a own guicontrol for every text you ever want to display on the screen, because showtext has no function to make it appear over gui controls

You can do this with only one GuiShowImgCtrl easily (which can also reside within any other GuiControl):

Here's something simple...
PHP Code:

//#CLIENTSIDE
function onCreated() {
  if (
LevelText != null) {
    
LevelText.destroy();
  }
  new 
GuiShowImgCtrl(LevelText) {
    
100;
    
text player.level.name;
  }
}

function 
onPlayerEnters() {
  
LevelText.text player.level.name;



zokemon 02-17-2007 02:31 PM

Quote:

Originally Posted by projectigi (Post 1278370)
....
i know how to create/destroy gui controls, thanks.

for example:

a Server wants to show a Text on the Screen that tells you the current Area
like "Online Start Local" "Kokiri Town" etc
now it sucks if you have to make a own guicontrol for every text you ever want to display on the screen, because showtext has no function to make it appear over gui controls

GuiMLTextCtrl.

showimg() basically just does this:

NPC Code:
function showimg(ti, tf, tx, ty) {
new TShowimg("showimg" @ ti) {
x = tx;
y = ty;
image = tf;
}
}



All times are GMT +2. The time now is 03:47 PM.

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