1. #1
    Deleted

    question about screen resolution

    hey all,

    on my to do list stands the experience/reputationbar

    tha plan is to stretch it from left to right at a 10 pixel height at the bottom.
    it should be dynamic to fit all resolutions so i began to work with GetScreenWidth() or UIParent:GetWidth().

    somehow the texture stops round about 3 inches before the screen ends (1920x1080 don't use UIScale).
    same with the 10% markers. they should be evenly spread over the bar.
    so is there something i don't know about any secret blizzard resolution api or so?

    thank you to everyony who could help me with that probelm.

  2. #2
    Deleted
    Why don't you simply SetPoint to BOTTOMLEFT and BOTTOMRIGHT on UIParent?

  3. #3
    Deleted
    that's what i'v edone for the bar, but how can it be done with the 10% markers. how can it be done that every 10% a marker appears?

    - - - Updated - - -

    so, noone can make any suggestions exept what treeston said?

  4. #4
    have you tried something like:

    Code:
    local screensize = GetScreenWidth() 
    
    xpbar:SetPoint("BOTTOM")
    xpbar:SetSize(screensize, "10")

  5. #5
    Deleted
    Put a OnSizeChanged script on the bar, divide :GetWidth() by 10, then place the markers accordingly (1*x, 2*x, 3*x, 4*x ... 9*x from BOTTOMLEFT and TOPLEFT).

  6. #6
    Deleted
    what i got now is the following.
    when i try f:GetWidth() and divide it by 10 to place the markers it doesn't fit.
    somehow if i divide by 7.1 it fits nearly perfect, but only on a resolution of 1920x1080.
    as soon as i change the resolution it's a mess again.


    this is what happens when i try UIParent:GetWith() or GetScreenWidth()


    the exp/reputationbar is set with setpoint BOTTOMLEFT and BOTTOMRIGHT but not the bar background
    Last edited by mmocfa0c4bf235; 2013-07-23 at 12:17 PM.

  7. #7
    Deleted
    Can you paste your code?

  8. #8
    Deleted
    will do it when at home

    this is my code.
    please don't get a heart attack it's all for testing purposes so uses no templates, cleaned code etc.
    that's only the bg and the marker.
    the exp and reputationbar are written in my oUF layout


    Code:
    -----------------------------------------------------------------------------------------------
    --- EXPERIENCEBACKGROUND ----------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------
    local screensize = GetScreenWidth() 
    local MyScreenWidth = (AoCExpRepBG:GetWidth() /7.1)
    
    local AoCExpRepBG = CreateFrame("Frame", nil, UIParent)
          AoCExpRepBG:SetPoint("BOTTOM")
          --AoCExpRepBG:SetPoint("BOTTOMRIGHT")
          --AoCExpRepBG:SetPoint("BOTTOMRIGHT")
          AoCExpRepBG:SetFrameStrata("BACKGROUND")
          AoCExpRepBG:SetFrameLevel((MyFrameLevel)+1)
          --AoCExpRepBG:SetHeight(16)
    
          AoCExpRepBG:SetSize(screensize, "16")
    
          local AoCExpRepBGTex = AoCExpRepBG:CreateTexture()
                AoCExpRepBGTex:SetParent(AoCExpRepBG)
                AoCExpRepBGTex:SetAllPoints(AoCExpRepBG)
                AoCExpRepBGTex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_empty.tga")  
                
               
    
               
    local AoCExpRepMark00 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark00:SetPoint("CENTER", AoCExpRepBG, -(5*MyScreenWidth),0)
          AoCExpRepMark00:SetFrameStrata("LOW")
          AoCExpRepMark00:SetFrameLevel(3)
          AoCExpRepMark00:SetWidth(54)      
          AoCExpRepMark00:SetHeight(22)
    
          local AoCExpRepMark00Tex = AoCExpRepMark00:CreateTexture()
                AoCExpRepMark00Tex:SetParent(AoCExpRepMark00)
                AoCExpRepMark00Tex:SetAllPoints(AoCExpRepMark00)
                AoCExpRepMark00Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark10 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark10:SetPoint("CENTER", AoCExpRepBG, -(4*MyScreenWidth),0)
          AoCExpRepMark10:SetFrameStrata("LOW")
          AoCExpRepMark10:SetFrameLevel(3)
          AoCExpRepMark10:SetWidth(54)      
          AoCExpRepMark10:SetHeight(22)
    
          local AoCExpRepMark10Tex = AoCExpRepMark10:CreateTexture()
                AoCExpRepMark10Tex:SetParent(AoCExpRepMark10)
                AoCExpRepMark10Tex:SetAllPoints(AoCExpRepMark10)
                AoCExpRepMark10Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark20 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark20:SetPoint("CENTER", AoCExpRepBG, -(3*MyScreenWidth),0)
          AoCExpRepMark20:SetFrameStrata("LOW")
          AoCExpRepMark20:SetFrameLevel(3)
          AoCExpRepMark20:SetWidth(54)      
          AoCExpRepMark20:SetHeight(22)
    
          local AoCExpRepMark20Tex = AoCExpRepMark20:CreateTexture()
                AoCExpRepMark20Tex:SetParent(AoCExpRepMark20)
                AoCExpRepMark20Tex:SetAllPoints(AoCExpRepMark20)
                AoCExpRepMark20Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark30 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark30:SetPoint("CENTER", AoCExpRepBG, -(2*MyScreenWidth),0)
          AoCExpRepMark30:SetFrameStrata("LOW")
          AoCExpRepMark30:SetFrameLevel(3)
          AoCExpRepMark30:SetWidth(54)      
          AoCExpRepMark30:SetHeight(22)
    
          local AoCExpRepMark30Tex = AoCExpRepMark30:CreateTexture()
                AoCExpRepMark30Tex:SetParent(AoCExpRepMark30)
                AoCExpRepMark30Tex:SetAllPoints(AoCExpRepMark30)
                AoCExpRepMark30Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark40 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark40:SetPoint("CENTER", AoCExpRepBG, -(1*MyScreenWidth),0)
          AoCExpRepMark40:SetFrameStrata("LOW")
          AoCExpRepMark40:SetFrameLevel(3)
          AoCExpRepMark40:SetWidth(54)      
          AoCExpRepMark40:SetHeight(22)
    
          local AoCExpRepMark40Tex = AoCExpRepMark40:CreateTexture()
                AoCExpRepMark40Tex:SetParent(AoCExpRepMark40)
                AoCExpRepMark40Tex:SetAllPoints(AoCExpRepMark40)
                AoCExpRepMark40Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark50 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark50:SetPoint("CENTER", AoCExpRepBG, "CENTER", 0, 0)
          AoCExpRepMark50:SetFrameStrata("LOW")
          AoCExpRepMark50:SetFrameLevel(3)
          AoCExpRepMark50:SetWidth(54)      
          AoCExpRepMark50:SetHeight(22)
    
          local AoCExpRepMark50Tex = AoCExpRepMark50:CreateTexture()
                AoCExpRepMark50Tex:SetParent(AoCExpRepMark50)
                AoCExpRepMark50Tex:SetAllPoints(AoCExpRepMark50)
                AoCExpRepMark50Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
    
    local AoCExpRepMark60 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark60:SetPoint("CENTER", AoCExpRepBG, (1*MyScreenWidth),0)
          AoCExpRepMark60:SetFrameStrata("LOW")
          AoCExpRepMark60:SetFrameLevel(3)
          AoCExpRepMark60:SetWidth(54)      
          AoCExpRepMark60:SetHeight(22)
    
          local AoCExpRepMark60Tex = AoCExpRepMark60:CreateTexture()
                AoCExpRepMark60Tex:SetParent(AoCExpRepMark60)
                AoCExpRepMark60Tex:SetAllPoints(AoCExpRepMark60)
                AoCExpRepMark60Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")            
    
    local AoCExpRepMark01 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark01:SetPoint("CENTER", AoCExpRepBG, (2*MyScreenWidth),0)
          AoCExpRepMark01:SetFrameStrata("LOW")
          AoCExpRepMark01:SetFrameLevel(3)
          AoCExpRepMark01:SetWidth(54)      
          AoCExpRepMark01:SetHeight(22)
    
          local AoCExpRepMark01Tex = AoCExpRepMark01:CreateTexture()
                AoCExpRepMark01Tex:SetParent(AoCExpRepMark01)
                AoCExpRepMark01Tex:SetAllPoints(AoCExpRepMark01)
                AoCExpRepMark01Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
                
    local AoCExpRepMark90 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark90:SetPoint("CENTER", AoCExpRepBG, (3*MyScreenWidth),0)
          AoCExpRepMark90:SetFrameStrata("LOW")
          AoCExpRepMark90:SetFrameLevel(3)
          AoCExpRepMark90:SetWidth(54)      
          AoCExpRepMark90:SetHeight(22)
    
          local AoCExpRepMark90Tex = AoCExpRepMark90:CreateTexture()
                AoCExpRepMark90Tex:SetParent(AoCExpRepMark90)
                AoCExpRepMark90Tex:SetAllPoints(AoCExpRepMark90)
                AoCExpRepMark90Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
    
    local AoCExpRepMark01 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark01:SetPoint("CENTER", AoCExpRepBG, (4*MyScreenWidth),0)
          AoCExpRepMark01:SetFrameStrata("LOW")
          AoCExpRepMark01:SetFrameLevel(3)
          AoCExpRepMark01:SetWidth(54)      
          AoCExpRepMark01:SetHeight(22)
    
          local AoCExpRepMark01Tex = AoCExpRepMark01:CreateTexture()
                AoCExpRepMark01Tex:SetParent(AoCExpRepMark01)
                AoCExpRepMark01Tex:SetAllPoints(AoCExpRepMark01)
                AoCExpRepMark01Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga") 
    
    local AoCExpRepMark58 = CreateFrame("Frame", nil, AoCExpRepBG)
          AoCExpRepMark58:SetPoint("CENTER", AoCExpRepBG, (5*MyScreenWidth),0)
          AoCExpRepMark58:SetFrameStrata("LOW")
          AoCExpRepMark58:SetFrameLevel(3)
          AoCExpRepMark58:SetWidth(54)      
          AoCExpRepMark58:SetHeight(22)
    
          local AoCExpRepMark58Tex = AoCExpRepMark58:CreateTexture()
                AoCExpRepMark58Tex:SetParent(AoCExpRepMark58)
                AoCExpRepMark58Tex:SetAllPoints(AoCExpRepMark58)
                AoCExpRepMark58Tex:SetTexture("Interface\\Addons\\zMedia\\experience\\experiencebar_marker.tga")
    plz be merciful, i know it's a mess at the moment
    Last edited by mmocfa0c4bf235; 2013-07-23 at 02:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •