Graal Forums

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

Kyranki 12-17-2007 10:29 PM

GuiShowImgCtrls
 
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
this.signedin false;
  
makeControls();
}
public function 
makeControls() {
  new 
GuiShowImgCtrl(L_Background) {
    
image "galdor_background-login.png";
    
extent = {getImgWidth("galdor_background-login.png"), getImgHeight("galdor_background-login.png")};
    
position = {00};
    
visible true;
  }


I have never been good with using GuiShowImgCtrls and according to common script information this should work perfectly fine yet I see nada.

DustyPorViva 12-17-2007 10:40 PM

You're using getImgWidth/getImgHeight. This is all well and all, but they will not give you the correct width/height until the image is loaded in the cache(after it downloads)... and since you're calling this onCreated, and not in a timeout loop, it most likely isn't updated. Also, try bitmap="image"; and see if that makes a difference. I doubt it though.
If you're still having problems, try deducing what could be causing the problem. Change the image to something you KNOW works, like head0.png. Also, put an echo in the function to make sure the function is calling.

Kyranki 12-17-2007 10:54 PM

Dusty, I tried head0.png like you suggested that worked perfectly fine however the image did not show even within a timeout as you suggested. :O

DustyPorViva 12-17-2007 10:55 PM

So that means there's something wrong with the image itself.
Try doing a find on RC and seeing if it's downloadable. If it isn't move it to the correct folder(level/images) and try again.

Kyranki 12-17-2007 10:56 PM

It's downloadable and all.

DustyPorViva 12-17-2007 10:57 PM

So the ctrl works fine when you use head0.png?

Also, for future reference:
extent = {getImgWidth(image), getImgHeight(image)};

cbk1994 12-18-2007 03:56 AM

It bugs me when people use position and extent :(

x, y, width, height FTW

Kyranki 12-18-2007 04:32 AM

Problem was fixed either way thanks guys.


All times are GMT +2. The time now is 11:09 AM.

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