Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   showimg on top of gui window (https://forums.graalonline.com/forums/showthread.php?t=134265626)

sssssssssss 01-24-2012 06:42 AM

showimg on top of gui window
 
Is there a way to put my images using showimg on top of the gui window? It keeps putting the gui first, which I know is what it's supposed to do. I just don't feel like rescripting these items to be guiimages, and would really prefer to keep them like they are if there is a fix to this. I tried putting layer values in the gui windows and showimages, but that didn't work.

Crow 01-24-2012 08:47 AM

There's no way to achieve this, no. You can use GuiShowImgCtrl, though. A GUI Control which in its core is the same as a regular TShowImg object.

sssssssssss 01-25-2012 05:06 AM

It's just changing image numbers to gui names for the most part right? I think I just answered myself in that question, but eh.

DustyPorViva 01-25-2012 05:18 AM

No, GUI's fight for focus(not only render focus but input focus as well, like keyboard). You'll have to adjust them to make sure that they're being rendered appropriately and that they're not stealing input.

sssssssssss 01-25-2012 05:52 AM

Any documentation on this? I've searched and never heard of it. :X

sssssssssss 01-25-2012 06:20 AM

Maybe I'm better off asking why this doesn't work. :/ using showimg showed this up behind the gui. search_list isn't empty for sure.
PHP Code:

  for(temp.this.selected_num2temp.this.selected_num2 91temp.++) {
    
//player.chat = search_list[temp.v];
    
if (search_list[temp.v] != null ) {
    
      
//showImg(200+temp.v, "armageddon-iconbox.gif", new_x_position + 3, new_y_position + 30);
      //findImg(200+temp.v).layer = 5;
      //findImg(200+temp.v).mode = 1;
      
("shadow"@temp.v) = new GuiShowImgCtrl();
      (
"shadow"@temp.v).image "armageddon_inventory-iconbox.gif";
      (
"shadow"@temp.v).new_x_position 3;
      (
"shadow"@temp.v).new_y_position 30;
      (
"shadow"@temp.v).layer 5;
      (
"shadow"@temp.v).mode 1;
      
      
//showImg(600+temp.v, search_list[temp.v].image, new_x_position + 4, new_y_position + 5);
      //findImg(600+temp.v).layer = 6;
      //findImg(600+temp.v).mode = 1;
      
("weapon"@temp.v) = new GuiShowImgCtrl();
      (
"weapon"@temp.v).image search_list[temp.v].image;
      (
"weapon"@temp.v).new_x_position 4;
      (
"weapon"@temp.v).new_y_position 5;
      (
"weapon"@temp.v).layer 6;
      (
"weapon"@temp.v).mode 1


fowlplay4 01-25-2012 06:56 AM

Maybe try something like this:

PHP Code:

new GuiShowImgCtrl("Arm_Inventory_IconBox_" temp.v) {
  
new_x_position 3;
  
new_y_position 30;
  
image "armageddon_inventory-iconbox.gif";
  
mode 1;
  new 
GuiShowImgCtrl("Arm_Inventory_IconBox_" temp."_Icon") {
    
image search_list[temp.v].image;
    
4// Since it's a child of 'IconBox' it's x/y will be relative.
    
5// It should also draw above the icon box as well.
    
mode 1;
  }



Pelikano 01-25-2012 02:37 PM

Quote:

Originally Posted by sssssssssss (Post 1682658)
Maybe I'm better off asking why this doesn't work. :/ using showimg showed this up behind the gui. search_list isn't empty for sure.
PHP Code:

  for(temp.this.selected_num2temp.this.selected_num2 91temp.++) {
    
//player.chat = search_list[temp.v];
    
if (search_list[temp.v] != null ) {
    
      
//showImg(200+temp.v, "armageddon-iconbox.gif", new_x_position + 3, new_y_position + 30);
      //findImg(200+temp.v).layer = 5;
      //findImg(200+temp.v).mode = 1;
      
("shadow"@temp.v) = new GuiShowImgCtrl();
      (
"shadow"@temp.v).image "armageddon_inventory-iconbox.gif";
      (
"shadow"@temp.v).new_x_position 3;
      (
"shadow"@temp.v).new_y_position 30;
      (
"shadow"@temp.v).layer 5;
      (
"shadow"@temp.v).mode 1;
      
      
//showImg(600+temp.v, search_list[temp.v].image, new_x_position + 4, new_y_position + 5);
      //findImg(600+temp.v).layer = 6;
      //findImg(600+temp.v).mode = 1;
      
("weapon"@temp.v) = new GuiShowImgCtrl();
      (
"weapon"@temp.v).image search_list[temp.v].image;
      (
"weapon"@temp.v).new_x_position 4;
      (
"weapon"@temp.v).new_y_position 5;
      (
"weapon"@temp.v).layer 6;
      (
"weapon"@temp.v).mode 1


Did you actually add those to a GUIControl or anything?

Crow 01-25-2012 02:50 PM

Quote:

Originally Posted by Pelikano (Post 1682672)
Did you actually add those to a GUIControl or anything?

It's not like you have to.

Pelikano 01-25-2012 06:47 PM

Quote:

Originally Posted by Crow (Post 1682673)
It's not like you have to.

Yes you do...

If you don't want it to be inside a GUI, just do

GraalControl.addcontrol(yourImage);

if you want it to be inside your GUI just use your GuiControl instead of the GraalControl

DustyPorViva 01-25-2012 07:09 PM

Quote:

Originally Posted by Pelikano (Post 1682680)
Yes you do...

If you don't want it to be inside a GUI, just do

GraalControl.addcontrol(yourImage);

if you want it to be inside your GUI just use your GuiControl instead of the GraalControl

No you don't... if you don't nest them inside another GUI then they won't be a child of another GUI...

Pelikano 01-25-2012 07:25 PM

Quote:

Originally Posted by DustyPorViva (Post 1682681)
No you don't... if you don't nest them inside another GUI then they won't be a child of another GUI...

Everything is a child of another GUI... even if it's just GraalControl...

The way he's doing it he will have to manually add it to the GraalControl using .addcontrol

Crow 01-25-2012 07:37 PM

Quote:

Originally Posted by Pelikano (Post 1682682)
Everything is a child of another GUI... even if it's just GraalControl...

The way he's doing it he will have to manually add it to the GraalControl using .addcontrol

Controls are added to GraalControl by default. I'd be very grateful if you could just stop posting about things you apparently don't know jack about.

Pelikano 01-25-2012 08:54 PM

Quote:

Originally Posted by Crow (Post 1682683)
Controls are added to GraalControl by default. I'd be very grateful if you could just stop posting about things you apparently don't know jack about.

Controls are only added to GraalControl by default if you do:

PHP Code:

  new GuiShowImgCtrl("SomeImg") {
    
50;
    
50;
    
width 71;
    
height 96;
    
image "era_sam_hiddencard.png";
    
visible true;
  } 

But, if you do it like the OP and create a GuiShowImgCtrl object first, then set it's attributes you have to add it to GraalControl manually:

PHP Code:

  temp.guiImage = new GuiShowImgCtrl("SomeImg");
  
guiImage.50;
  
guiImage.50;
  
guiImage.width 71;
  
guiImage.height 96;
  
guiImage.image "era_sam_hiddencard.png";
  
guiImage.visible true;
  
// Will not show! 

Test it yourself. I'd be very grateful if you'd stop being totally arrogant and obviously you are the one who has no idea in this case.

Crow 01-25-2012 09:05 PM

Quote:

Originally Posted by Pelikano (Post 1682684)
Test it yourself.

I did in the past and I still have some code running somewhere where I do it just like the OP. It works either way and is added to GraalControl by default.


All times are GMT +2. The time now is 09:21 PM.

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