View Single Post
  #19  
Old 09-27-2007, 02:13 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Chompy View Post
Hmm, then my guess is, you're not giving them a coordinate in the Inventory control? I'm not used to use the inventory itself as an gui control.. I just use an image and then a for() loop and place them on the image itself..

and I use another method for placing them (Thanks Contiga for that one )
PHP Code:
+ (offsetx*index§iconshorizontal);
+ (offsety*int(index/iconsvertical)); 
for example for 6x6 icons I do:
PHP Code:
this.ix inventory.x;
this.iy inventory.y;
for(
temp.036++) {
  new 
GuiBitmapButtonCtrl("button_" i) {
    
thiso.ix 13.5 + (33*(i§6));
    
thiso.iy 165 + (33*int(i/6));
          
    
this.image "bomb.png";
          
    
normalbitmap this.image;
    
mouseoverbitmap this.image;
    
pressedbitmap this.image;

    
width 32;
    
height 32;
          
    
thiso.catchevent(this"onMouseDown""onItemPressed");
  }

PS: In the scripts I had to write § instead of o/o (percent symbol), stupid bad request **** =/
Sorry to revive this thread, but...that actually doesn't work, Chompy. =/
It works only for an even grid (like your 6x6 example)
So i changed the y to:
PHP Code:
temp.base[1] + (32*int(roundTo((temp.id/6),1.1))); 
roundTo() being Zero's roundTo() function.
PHP Code:
public function roundTo(valplace) {
  return 
int(val/place 0.5)*place;

But, that only works for TWO lines...(on a 4x6 grid)...so now I can't figure out how to do it.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote