Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gui problem... (https://forums.graalonline.com/forums/showthread.php?t=76174)

oo_jazz_oo 08-08-2007 09:41 PM

Gui problem...
 
Ok, I am having problems with the gui tree ctrl.
I want to set an icon, but it wont let me...
I changed icon size to 32x32, and tried everything to set an icon. ><
How do you do it? x.x

Chompy 08-08-2007 11:56 PM

PHP Code:

with (addnodebypath("Parent/Child","/")) {
  
image selectedimage 2;


:) Something like that

oo_jazz_oo 08-09-2007 12:11 AM

But that just makes the image the txt document image thing...
And that doesnt work when you resize the icons anyway.
I need to make the image my own icon,. -.-

Chompy 08-09-2007 12:16 AM

tried stuff like image = "bomb.png";?

oo_jazz_oo 08-09-2007 12:34 AM

Yes, and it does not work.

Chompy 08-09-2007 12:40 AM

closest stuff I could find was:

http://wiki.graal.net/index.php/Crea...uiTreeViewNode

so.. tried icon = "bomb.png";?
for example
PHP Code:

with (addnodebypath("Parent/Child","/")) {
  
icon "bomb.png";


If it doesn't help, I'm out of ideas :(

oo_jazz_oo 08-09-2007 12:55 AM

Thanks for trying, but still no. x.x

Skyld 08-09-2007 02:39 AM

The .icon is a TDrawingPanel I think; you might need to use something like:
PHP Code:

icon.drawimagerectangle(); 

There is info on the wiki about TDrawingPanels and their functions.

zokemon 08-09-2007 04:10 AM

Yes, first do seticonsize(w, h);
Then the icon variable is actually a TDrawingPanel object that you can use various functions such as:
  • icon.drawimage(int x, int y, str imagefilename)
  • icon.drawimagerectangle(int x, int y, str imagefilename, int sourcex, int sourcey, int sourcewidth, int sourceheight)
  • icon.drawimagestretched(int x, int y, int width, int height, str imagefilename, int sourcex, int sourcey, int sourcewidth, int sourceheight)

Here's an example:
NPC Code:
new GuiTreeViewCtrl("mytree") {
resize(0, 0, 50, 100); // sets x, y, w and h
seticonsize(32, 32);
clearnodes();
with (addnode("Category A")) {
icon.drawimagestretched(0, 0, 32, 32, "block.png", 0, 0, 32, 32);
with (addnode("Item A")) {
icon.drawimagestretched(0, 0, 32, 32, "head0.png", 0, 0, 32, 64);
}
with (addnode("Item B")) {
icon.drawimagestretched(0, 0, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(16, 0, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(16, 16, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(0, 16, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
}
}
}


Chompy 08-09-2007 11:27 AM

Then I was.. almost right ;O

oo_jazz_oo 08-10-2007 04:07 AM

Ok, now I need some more help. lol
It has to do with guis also...
Ok, I have a gui scroll ctrl with text inside it.
Now, as the player chats, the text adds line to what the player is saying.
When the text reaches the bottom of the scroll box, I need the scroll to go to the bottom.
Currently, it hides 1 line...
Say, its starting to stretch the scroll, and you say 'Test'. It will not show up, cause its hidden.
Then you say 'Test2', and 'Test' will show up and 'Test2' will be hidden...
I currently have the script set to this
texth1.scrollto(0, text123.height);
So, what ese can I do so it doesnt hide that 1 line?

zokemon 08-10-2007 08:39 AM

I told you this in your IM but you ignored me:

If it is a GuiMLTextCtrl that is inside the GuiScrollCtrl you can simple call the function scrolltobottom() for the GuiMLTextCtrl.

Also, I see chat history systems are becoming quite the fad ever since i made my first version on Maloria v3. ^_^

xXziroXx 08-10-2007 12:03 PM

Quote:

Originally Posted by zokemon (Post 1338677)
I told you this in your IM but you ignored me:

If it is a GuiMLTextCtrl that is inside the GuiScrollCtrl you can simple call the function scrolltobottom() for the GuiMLTextCtrl.

Also, I see chat history systems are becoming quite the fad ever since i made my first version on Maloria v3. ^_^

I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.

Twinny 08-10-2007 01:09 PM

Quote:

Originally Posted by xXziroXx (Post 1338700)
I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.

Pretty sure Thamhic had it way before as well. Possibly before Mythic.

xXziroXx 08-10-2007 01:36 PM

Quote:

Originally Posted by Twinny (Post 1338718)
Pretty sure Thamhic had it way before as well. Possibly before Mythic.

I dont think Thamic existed over a year ago, or?

Skyld 08-10-2007 01:41 PM

Quote:

Originally Posted by xXziroXx (Post 1338700)
I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.

A chat system was one of the first things I prototyped when Rudora had GScript2-enabled back in the Graal 3 days, and that was quite some time before any of this.

Twinny 08-10-2007 01:55 PM

Quote:

Originally Posted by xXziroXx (Post 1338721)
I dont think Thamic existed over a year ago, or?

http://forums.graalonline.com/forums...hlight=Thamhic

That's just the release. The server may have been up alot longer before that.

zokemon 08-10-2007 02:58 PM

I was more referring to an improved version of the ChatBar object and chat of the player's head type of system but meh, I'll stand corrected to avoid pointless arguing.

xXziroXx 08-10-2007 03:51 PM

^^

<3 Zero, Skyld, Twinny


All times are GMT +2. The time now is 07:11 PM.

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