View Single Post
  #2  
Old 05-28-2012, 11:19 PM
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
Not the way you want it, but I wish there was an easy way to offset the position of the shape/npc.

You have to use showimg to draw the image within that box, then you can use some simple math to determine the center position ((max_width - width) / 2). I.e.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
setshape(1,80,80);
  
drawBlock();
}

function 
drawBlock() {
  
temp.shapewidth 80 16// Converting the width from pixels to tiles
  
temp.shapeheight 80 16;
  
temp.blockwidth 32 16;
  
temp.blockheight 32 16;
  
with (findimg(200)) {
    
image "block.png";
    
thiso.+ ((temp.shapewidth temp.blockwidth) / 2);
    
thiso.+ ((temp.shapeheight temp.blockheight) / 2);
  }

__________________
Quote:
Reply With Quote