View Single Post
  #7  
Old 08-20-2009, 02:31 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
Here's an example of how to draw an image and stretch it accordingly.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
// Draw Stretched Block
  
temp.img = onDrawImage(200, "block.png", 48, 48);
  
// Adjust Blocks X + Y for example purposes.
  
with (temp.img) {
     
x = player.x;
     
y = player.y;
  }
}

// Draws an Image and stretches to the desired width and height.

function onDrawImage(img_id, img_name, img_width, img_height) {
  
// Initialize Image Object
  
with (findimg(img_id)) {
    
// Specify Image
    
image = img_name;
    
// Determine Real Width & Height of Image
    
temp.real_width = getimgwidth(image);
    
temp.real_height = getimgheight(image);
    
// Default stretch values = 1, so if you want to stretch it twice it's width, you'd have to use 2.
    // Therefore: stretch = new_width / real_width;
    
stretchx = img_width / temp.real_width;
    
stretchy = img_height / temp.real_height;
  }
  
// Return Image Object for Manipulation
  
return findimg(img_id);
} 
Instead of a block, you could use an image of a bubble instead, however a more complicated solution may be needed to make it look good.
__________________
Quote:
Reply With Quote