Thread Tools Display Modes
03-25-11, 03:44 PM   #1
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
Xpbar

Stexperience bar.
I have the look I want but I cant get it to the width i Want when i change the width it dissapears atm it is anchored to the top of my minimap.

here is the start lua if that helps.

-- Config ----------------
--------------------------
--Bar Height and Width
local barHeight, barWidth = 3, Minimap:GetWidth()2

--Where you want the fame to be anchored
--------AnchorPoint, AnchorTo, RelativePoint, xOffset, yOffset
local Anchor = { "TOP", Minimap, "TOP", 0 , 0 }

--Fonts
local showText = false -- Set to false to hide text
local mouseoverText = true -- Set to true to only show text on mouseover
local font,fontsize,flags = [[Interface\Addons\stExperienceBar\Media\homespun.ttf]], 10, "MONOCHROMEOUTLINE"

--Textures
local barTex = [[Interface\Addons\stExperienceBar\Media\Flat.tga]]
local flatTex = [[Interface\Addons\stExperienceBar\Media\Flat.tga]]
  Reply With Quote
03-25-11, 05:36 PM   #2
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Originally Posted by Oraknathal View Post
Stexperience bar.
-- Config ----------------
--------------------------
--Bar Height and Width
local barHeight, barWidth = 3, Minimap:GetWidth()2
Try changing Minimap:GetWidth()2 to something like just "3", that won't work in lua since you're just attaching a number to the end of a function. Remove the Minimap:GetWidth() all together and put your own plain number or you can do something like "Minimap:GetWidth()+5" to go 5 (units) wider than the minimap.
  Reply With Quote
03-25-11, 08:11 PM   #3
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
Originally Posted by Waky View Post
Try changing Minimap:GetWidth()2 to something like just "3", that won't work in lua since you're just attaching a number to the end of a function. Remove the Minimap:GetWidth() all together and put your own plain number or you can do something like "Minimap:GetWidth()+5" to go 5 (units) wider than the minimap.
So what should my LUA look like if I wanted to make the width manually?
As in how should it look like after i remove the minimap:getwidth()?
Soz im just not good at lua
  Reply With Quote
03-25-11, 09:23 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Oraknathal View Post
Minimap:GetWidth()2
You should be getting a Lua error here. As Waky mentioned, you have a number attached to your function call which won't work. What exactly are you trying to accomplish with this "2"?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-26-11, 02:54 AM   #5
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
Its from carebears ui and it was meant to say -2 But I dont really want it there I just want my bar width to match my map I Dont know what to change in the code to change the width.
  Reply With Quote
03-26-11, 12:07 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Minimap:GetWidth()

^^ == get the width of the minimap. Carebear's -2 was 2 less than the width of the minimap.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-26-11, 02:55 PM   #7
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
the minimap is about 140 pixels long but when I try put lets say 0 as the width instead of -2 the bar will disappear
  Reply With Quote
03-26-11, 04:02 PM   #8
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Oraknathal View Post
the minimap is about 140 pixels long but when I try put lets say 0 as the width instead of -2 the bar will disappear
Forget about the number.

Code:
local barHeight, barWidth = 3, Minimap:GetWidth()
  Reply With Quote
03-26-11, 04:07 PM   #9
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Originally Posted by Nibelheim View Post
Forget about the number.

Code:
local barHeight, barWidth = 3, Minimap:GetWidth()
I had the code at one time, to have the width and height anything I'd like, but lost it moving to a diff computer. Any way to just get rid of a the Minimap GetWidth and just have width = somenumber and height = somenumber?
__________________
  Reply With Quote
03-26-11, 04:16 PM   #10
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Kendian View Post
I had the code at one time, to have the width and height anything I'd like, but lost it moving to a diff computer. Any way to just get rid of a the Minimap GetWidth and just have width = somenumber and height = somenumber?
Yep. All Minimap:GetWidth() does is return a number, so replacing it with one is fine.
  Reply With Quote
03-26-11, 04:39 PM   #11
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
This is what it looks like after the,
local barHeight, barWidth = 3, Minimap:GetWidth() code was input


http://img825.imageshack.us/f/wowscr...711093623.jpg/
  Reply With Quote
03-26-11, 04:49 PM   #12
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
lol forgot to add to question in earlier post.

what I mean to say is what exactly should my LUA look like.
without the numbers obviously I'll input the numbers to make the the bar's width,height to my preference but what should change in my code to allow me do this.
I want to delete the getminimap lua line thingy so I can personally adjust mu width and height but how should the lua look like after?
  Reply With Quote
03-26-11, 07:09 PM   #13
Dainton
A Flamescale Wyrmkin
 
Dainton's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 115
If you want it to be the width of your minimap then shouldn't it be something like
Code:
local barHeight, barWidth = 3, Minimap:GetWidth()*Minimap:GetScale()
that?
  Reply With Quote
03-26-11, 07:34 PM   #14
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
If he has his minimap scaled to something other than 1, yeah.


and...
the minimap is about 140 pixels long but when I try put lets say 0 as the width instead of -2 the bar will disappear
Well yeah - if you put a width of 0, it's going to be 0 "pixels" long. /edit: unless you mean Minimap:GetWidth()0, then you're back to the exact same error mentioned above. It should be + or - 0.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-26-11, 09:10 PM   #15
Othgar
"That" Guy
 
Othgar's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 228
Originally Posted by Oraknathal View Post
local barHeight, barWidth = 3, Minimap:GetWidth()
I'm no pro at Lua or anything but wouldn't "barWidth = 3" set the bar width to 3 leaving "Minimap:GetWidth()" serving no purpose?

Please tell me to go away if I'm wrong though lol
__________________


  Reply With Quote
03-26-11, 09:30 PM   #16
Andone
A Deviate Faerie Dragon
Join Date: Dec 2009
Posts: 10
local barHeight, barWidth = 3, Minimap:GetWidth()

means the barheight is 3 and barwidth is Minimap:GetWidth() ...seperated by the comma.
  Reply With Quote
03-26-11, 09:37 PM   #17
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It's like saying "a and b are equal to 1 and 2 respectively".
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-26-11, 09:48 PM   #18
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Dainton View Post
If you want it to be the width of your minimap then shouldn't it be something like
Code:
local barHeight, barWidth = 3, Minimap:GetWidth()*Minimap:GetScale()
that?
Yep, if the xpbar isn't parented to the Minimap. Otherwise it's scale will remain relative to the Minimap's.
  Reply With Quote
03-27-11, 03:18 AM   #19
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
so how do I unparent it?
  Reply With Quote
03-27-11, 03:32 AM   #20
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Oraknathal View Post
so how do I unparent it?
Code:
local Anchor = { "TOP", Minimap, "TOP", 0 , 0 }
to

Code:
local Anchor = { "TOPRIGHT", UIParent, "TOPRIGHT", 0 , 0 }
You'll need to change the last two numbers (X, Y) to move your bar. Both numbers will go negative to move the bar left and down. I.e.

Code:
local Anchor = { "TOPRIGHT", UIParent, "TOPRIGHT", -20 , -10 }
Will move your bar 20 pixels left, and 10 pixels down.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Xpbar


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