Thread Tools Display Modes
05-16-11, 10:07 PM   #1
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Bag Issue

Hello,
i'm trying to convert the standard bags over to some better looking bags while keeping some of the standard artwork.

Ok here is a screen shot with arrows pointing to my issues i'm coming across:




other then these 2 issues i think I'm just about there.

If someone could give me a hand in coding on this, it would be much appreciated.

one thing i know is that

_G['ContainerFrame'..i.."Name"] is how i can get to the name but being able to set the width of the name and the position is where im getting stuck.

As for the backpack image i think its linked in with the default frame it self which in turn might mean no image.

Thanks in advance for any help with this.

Coke
  Reply With Quote
05-17-11, 03:14 AM   #2
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 131
The ContainerFrame1 icon is
Code:
 Interface\Icons\INV_Misc_Bag_08
which is the same as for the
Traveler's Backpack.


The bag name is a fontstring with the following settings:
Code:
<FontString name="$parentName" inherits="GameFontHighlight">
	<Size>
		<AbsDimension x="112" y="12"/>
	</Size>
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="47" y="-10"/>
			</Offset>
		</Anchor>
	</Anchors>
</FontString>
so you just have to delete its position and define it as you like it.

e.g. if you want to move it 10 pixel to the right (in the standard UI):
Code:
for i = 1,5 do
	local parent = _G["ContainerFrame"..i]
	local text = _G["ContainerFrame"..i.."Name"]
	text:ClearAllPoints()
	text:SetPoint("TOPLEFT", parent, "TOPLEFT", "57", "-10")
end
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker

Last edited by humfras : 05-17-11 at 03:33 AM. Reason: better readable code
  Reply With Quote
05-17-11, 09:54 AM   #3
Dura
A Murloc Raider
Join Date: Apr 2011
Posts: 6
You might just want Bagnon
  Reply With Quote
05-21-11, 01:36 AM   #4
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
if you can get ahold of the font string, you can call fontstring:GetStringWidth() and perhaps do math to see where you need to position it.

an easier solution might be to have the font string anchor its left point to the right point of the image, and the right point to the right point of the frame (keeping things aligned so maybe the top right of the frame and do a little offsetting

that way it always auto centers
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote
05-25-11, 10:03 PM   #5
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by humfras View Post
Code:
for i = 1,5 do
	local parent = _G["ContainerFrame"..i]
	local text = _G["ContainerFrame"..i.."Name"]
	text:ClearAllPoints()
	text:SetPoint("TOPLEFT", parent, "TOPLEFT", "57", "-10")
end
Worked perfectly ty for the help.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Bag Issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off