Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   ShowImg w/ Screenwidth (https://forums.graalonline.com/forums/showthread.php?t=134266522)

greggiles 05-27-2012 12:50 AM

ShowImg w/ Screenwidth
 
For the showImg(i, "image", x, y) how do I get it stay stay on the right side of the screen if with screen size changes? I know it has to do with multiplying by the width, but I forgot the code :(

Tricxta 05-27-2012 01:06 AM

you want screenwidth - the img height

PHP Code:

with(findimg(index)){
  
img "something.png";
  
screenwidth-img.height;
  
20;
  
layer 4;


Not certain you can reference the height property of the image that easily though... but you get the gist.

fowlplay4 05-27-2012 01:55 AM

You can do so like this:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
drawBlock();
}

function 
GraalControl.onResize() {
  
drawBlock();
}

function 
drawBlock() {
  
with (findimg(200)) {
    
image "block.png";
    
width 32// I set the width statically, since getimgwidth(image) 
                // will return 0 if the image isn't downloaded yet.
    
screenwidth width 16;
    
16;
    
layer 4;
  }




All times are GMT +2. The time now is 06:39 PM.

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