View Single Post
  #1  
Old 05-29-2007, 06:45 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Graphical Interface

Here's a simple gui effect

HTML Code:
//#CLIENTSIDE
function onCreated()
{
  playergui = this;
  this.startGui();
}

function startGui()
{
  this.guiPosition = {2, 2};
   
  this.updateData();
  
  for (temp.currentImage: this.imageData)
  {
    this.drawImage(temp.currentImage);
  }
}
function updateData()
{
  this.imageData = {
    {200, "c_gui-base.png", this.guiPosition, 4},
    {201, player.headimg, {(this.guiPosition[0] + 4), (this.guiPosition[1] + 6)}, 5, {0, 64, 32, 32}},
    {202, "c_gui-hpbar.png", {(this.guiPosition[0] + 42), (this.guiPosition[1] + 11)}, 5, {0, 0, this.findBar("hp"), 7}},
    {203, "c_gui-mpbar.png", {(this.guiPosition[0] + 42), (this.guiPosition[1] + 22)}, 5, {0, 0, 59, 7}}
  };
}
function drawImage(imageData)
{
  showimg(temp.imageData[0], temp.imageData[1], temp.imageData[2][0], temp.imageData[2][1]);
  changeimgvis(temp.imageData[0], temp.imageData[3]);
  if (temp.imageData[4].size() == 4)
  {
    changeimgpart(temp.imageData[0], temp.imageData[4][0], temp.imageData[4][1], temp.imageData[4][2],temp.imageData[4][3]);
  }
}

function findBar(barType)
{
  if (temp.barType == "hp")
    return ((player.hearts / player.fullhearts) * 59 <= 1? 1: (player.hearts / player.fullhearts) * 59);
}

public function updateHP()
{
  this.updateData();
  this.drawImage(this.imageData[2]);
}

public function updateMP()
{ 
  //place holder, make your own! 
}
public function hideGui()
{
  hideimgs(200, 210);
}
Here are the images! It's the top left gui thing.
Attached Thumbnails
Click image for larger version

Name:	myGui.png
Views:	365
Size:	24.6 KB
ID:	41353  
Attached Images
   
__________________
Reply With Quote