|
That one guy...
|
 |
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
|
|
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);
}
}
}
|
__________________
Do it with a DON!
|
|