first code.. your to fast LOL second one works great ty.
---------- Post added 2011-09-12 at 09:15 PM ----------
so i'm not creating new posts for all thing ill just post my question here.
When i put my datapanel at the bottom of the screen i have to also move the bags up 20-30 pixels also right now the code im using for this process is kinda the default container code with a few number changes. Its a rather big code and i would like to make it smaller.
Code:
-- Move the Bags above the Actionbar
CONTAINER_WIDTH = 192;
CONTAINER_SPACING = 5;
VISIBLE_CONTAINER_SPACING = 3;
CONTAINER_OFFSET_Y = 70;
CONTAINER_OFFSET_X = 0;
function updateContainerFrameAnchors()
local _, xOffset, yOffset, _, _, _, _;
local containerScale = 1;
screenHeight = GetScreenHeight() / containerScale;
-- Adjust the start anchor for bags depending on the multibars
xOffset = CONTAINER_OFFSET_X / containerScale;
yOffset = CONTAINER_OFFSET_Y / containerScale + 25;
-- freeScreenHeight determines when to start a new column of bags
freeScreenHeight = screenHeight - yOffset;
column = 0;
for index, frameName in ipairs(ContainerFrame1.bags) do
frame = _G[frameName];
frame:SetScale(containerScale);
if ( index == 1 ) then
-- First bag
frame:SetPoint('BOTTOMRIGHT', frame:GetParent(), 'BOTTOMRIGHT', -xOffset, yOffset );
elseif ( freeScreenHeight < frame:GetHeight() ) then
-- Start a new column
column = column + 1;
freeScreenHeight = screenHeight - yOffset;
frame:SetPoint('BOTTOMRIGHT', frame:GetParent(), 'BOTTOMRIGHT', -(column * CONTAINER_WIDTH) - xOffset, yOffset );
else
-- Anchor to the previous bag
frame:SetPoint('BOTTOMRIGHT', ContainerFrame1.bags[index - 1], 'TOPRIGHT', 0, CONTAINER_SPACING);
end
freeScreenHeight = freeScreenHeight - frame:GetHeight() - VISIBLE_CONTAINER_SPACING;
end
end
The red code is the only change i need made.
Thanks