A Chromatic Dragonspawn
Join Date: May 2011
Posts: 162
|
Originally Posted by Tim
Code:
local DummyFrame = CreateFrame("Frame")
|
Originally Posted by Tim
Code:
DummyFrame:SetScript("OnEvent", function(self, event, ...)
if (event == "PLAYER_ENTERING_WORLD") then
ChatFrame1:SetPoint("BOTTOMLEFT", LeftChatBaseFrame, "BOTTOMLEFT", 0, 0)
ChatFrame1:SetPoint("TOPRIGHT", LeftChatBaseFrame, "BOTTOMLEFT", 451, 241)
ChatFrame2:SetPoint("BOTTOMLEFT", RightChatBaseFrame, "BOTTOMLEFT", 8, 0)
ChatFrame2:SetPoint("TOPRIGHT", RightChatBaseFrame, "BOTTOMLEFT", 455, 194)
end
end)
Of course for this to work you're going to need a valid parent named LeftChatBaseFrame and RightChatBaseFrame. You may need/want to clear all points for both chat frames as well. ChatFrame1:ClearAllPoints() ChatFrame2:ClearAllPoints() and those would need to be placed before the setpoints.
http://wowpedia.org/API_Frame_SetScript
|
ok here it is with the top portion of my code no longer referancing to the file that i was working on, i just dumped it in after my chat frame creation
Code:
-- welcome to Project Deranjata Artwork, Visual Style Portion of Project Deranjata
local aspect = CreateFrame("Frame", nil, UIParent)
aspect:RegisterEvent("PLAYER_ENTERING_WORLD")
aspect:SetScript("OnEvent", function(self, event)
UIParent:SetScale(0.6) -- you can change the scale here but you will break the entire add-on --
aspect:UnregisterAllEvents()
print ("Your Resolution Scale has been changed to 0.6")
print ("Welcome to Project Deranjata, Version 0.0.1.0a, Your input is Needed, please be sure to visit us on www.wowinterface.com . all input is welcomed, next stage is Action Bars. Have fun and !!!Good Luck!!!")
end)
local resolHeight = GetScreenHeight()
local resolWidth = GetScreenWidth()
local aspectRatio = (resolWidth/resolHeight)
print(format("If this function works, your aspect ratio is %.2f.", aspectRatio))
--This is the Backdrop Variable--
local backdrop = {
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
tileSize = 32,
edgeSize = 20,
insets = {
left = 4,
right = 4,
top = 4,
bottom = 4,
}
}
local backdropClear = {
--bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
tileSize = 32,
edgeSize = 20,
insets = {
left = 4,
right = 4,
top = 4,
bottom = 4,
}
}
-- This is Left Main Frame Chunk
local frame = CreateFrame("frame", "LeftChatBaseFrame", UIParent)
LeftChatBaseFrame:SetWidth(resolWidth*.34)
LeftChatBaseFrame:SetHeight(resolHeight*.33)
LeftChatBaseFrame:SetPoint("BOTTOMLEFT", UIParent,"BOTTOMLEFT", -6, -6)
LeftChatBaseFrame:SetFrameStrata("BACKGROUND")
LeftChatBaseFrame:SetFrameLevel(1)
LeftChatBaseFrame:SetAlpha(1)
LeftChatBaseFrame:SetBackdrop(backdrop)
-- This is Right Main Frame Chunk
local frame = CreateFrame("frame", "RightChatBaseFrame", UIParent)
RightChatBaseFrame:SetWidth(resolWidth*.34)
RightChatBaseFrame:SetHeight(resolHeight*.33)
RightChatBaseFrame:SetPoint("BOTTOMRIGHT", UIParent,"BOTTOMRIGHT", 6, -6)
RightChatBaseFrame:SetFrameStrata("BACKGROUND")
RightChatBaseFrame:SetFrameLevel(1)
RightChatBaseFrame:SetAlpha(1)
RightChatBaseFrame:SetBackdrop(backdrop)
--set chat frame to proper position
local DummyFrame = CreateFrame("Frame")
DummyFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
DummyFrame:SetScript("OnEvent", function(self, event, ...)
if (event == "PLAYER_ENTERING_WORLD") then
ChatFrame1:ClearAllPoints()
ChatFrame2:ClearAllPoints()
ChatFrame1:SetPoint("BOTTOMLEFT", LeftChatBaseFrame, "BOTTOMLEFT", 0, 0)
ChatFrame1:SetPoint("TOPRIGHT", LeftChatBaseFrame, "BOTTOMLEFT", 451, 241)
ChatFrame2:SetPoint("BOTTOMLEFT", RightChatBaseFrame, "BOTTOMLEFT", 8, 0)
ChatFrame2:SetPoint("TOPRIGHT", RightChatBaseFrame, "BOTTOMLEFT", 455, 194)
end
end)
took the advice on the CAP function, also added in a Register event so it could see it happening
|