atom/proc/Display_Number(items/o,num)
if(num>999999)
num=999999
var/numlength=num2text(num,7)
var/image/num1
var/image/num2
var/image/num3
var/image/num4
var/image/num5
var/image/num6
if(length(string)>=0)
num1=image('Images/numbers.dmi',icon_state="[copytext(numlength,length(numlength),length(numlength)+1)]",pixel_x=-1,pixel_y=-12)
o.overlays+=num1
if(length(numlength)>=2)
num2=image('Images/numbers.dmi',icon_state="[copytext(numlength,(length(numlength)-1),(length(numlength)))]",pixel_x=-6,pixel_y=-12)
o.overlays+=num2
if(length(numlength)>=3)
num3=image('Images/numbers.dmi',icon_state="[copytext(numlength,(length(numlength)-2),(length(numlength)-1))]",pixel_x=-11,pixel_y=-12)
o.overlays+=num3
if(length(string)>=4)
num4=image('Images/numbers.dmi',icon_state="[copytext(numlength,(length(numlength)-3),(length(numlength)-2))]",pixel_x=-16,pixel_y=-12)
o.overlays+=num4
if(length(numlength)>=5)
num5=image('Images/numbers.dmi',icon_state="[copytext(numlength,(length(numlength)-4),(length(numlength)-3))]",pixel_x=-21)
o.overlays+=num5
if(length(numlength)>=6)
num6=image('Images/numbers.dmi',icon_state="[copytext(numlength,(length(numlength)-5),(length(numlength)-4))]",pixel_x=-26)
o.overlays+=num6
----
mob/proc/Update_Inventory()
var/no = 0
for(var/items/item in src)
Display_Number(item, item.amount) //send it to the item being looped and display its amount.
src << output(item, "viewchild_gridtwo:[++no]")
--extra clip to show my items that i want it to display to.. full clip of items.dm :D
items
parent_type = /obj
var
amount = 1
Equipment
var
colour = "#000000"
defense = 0
list/bonuses
eqslot
eqwear
TempClick
icon = 'NOICON.dmi'
bonuses = list()
Click()
if(src in usr.contents)
usr << "Clicked"
Display_Number(usr, 90)
// if(src.bonuses.len>0)
// usr << "G"
for(var/bonus in bonuses)
usr.vars[bonus] += bonuses[bonus]
else
src.Move(usr)
Problem description:
Ok so there shouldnt be anything wrong with getting this to display correctly. but for some reason whenever it goes to run it and output the numbers using the pixel_x's to align them it stacks them all up in one area (the first location and the default location of the numbers in the numbers.dmi)
Now ive even made it send to display on top of a player and it displays perfectly all the way upto the 999,999 which is the max that byond handles without doing that annoying 1+e006 bs.
so is it possible for anyone to explain why it works when outputting it to the player and aligns perfectly but when aligning to an object it fails to overlay properly.
~Midget
So anyone know whats going exactly.
Displays Perfectly when
~Outputting ontop of a player
~Outputting ontop of an item whens its NOT inside the player
Does not display when
~Inside a player.