Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-27-2012, 12:50 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
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
Reply With Quote
  #2  
Old 05-27-2012, 01:06 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
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.
Reply With Quote
  #3  
Old 05-27-2012, 01:55 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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;
  }

__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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