Thread Tools Display Modes
12-27-09, 07:44 PM   #1
rberry88
Premium Member
Join Date: Feb 2005
Posts: 42
Adding scale to a layout

I'm using oUF_shkm, he is no longer updating the mod since July and I was trying to get it a little larger by using the scale command. I'm new to lua but I added "local scale = 1.2" without the quotes at the beginning of the lua file where the other locals are defined but it has no effect.


Any easy way to add scaling to this layout?
  Reply With Quote
12-27-09, 09:30 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by rberry88 View Post
I'm using oUF_shkm, he is no longer updating the mod since July and I was trying to get it a little larger by using the scale command. I'm new to lua but I added "local scale = 1.2" without the quotes at the beginning of the lua file where the other locals are defined but it has no effect.


Any easy way to add scaling to this layout?

Defining a local is not necessary to scale frames. It's a way to apply the same number to all places where you use a scale, though.

For example ...

Setting a scale goes more or less like this (the numbers in brackets are the scale values which vary in my example below):

oUF_Player:SetScale(1.0)
oUF_Target:SetScale(1.4)
oUF_Focus:SetScale(0.6)

in your case, you could apply your local like this
oUF_Player:SetScale(Scale)
oUF_Target:SetScale(Scale)
oUF_Focus:SetScale(Scale)

which would result in all frames being scaled by 1.2
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
12-27-09, 10:35 PM   #3
rberry88
Premium Member
Join Date: Feb 2005
Posts: 42
Awesome, thanks a lot. Works like a charm.
  Reply With Quote
12-28-09, 02:28 AM   #4
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
A way to do it without having to set it for each one (unless that's what you want to do ) is to add a line at the end of the layout function that looks like this:
self:SetAttribute('initial-scale', 1.2)

That way they're all set as they're created. I'm not sure if SetScale is protected during combat or not, but if so you can run into problems if the unit frames are created during combat (logging in after a DC, for example). Using SetAttribute gets around that.
  Reply With Quote
12-28-09, 07:20 AM   #5
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by wurmfood View Post
That way they're all set as they're created. I'm not sure if SetScale is protected during combat or not, but if so you can run into problems if the unit frames are created during combat (logging in after a DC, for example). Using SetAttribute gets around that.
Mhm, sounds possible. I'm using the SetScale code for my layout(s) and never got any issue reports. I'm not using those options myself, though. I just put them in, because others might have a use for it.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
12-28-09, 07:36 AM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
:SetScale() is protected in combat. Just set the attributes instead and let oUF/Blizzard handle it and you'll be fine.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Adding scale to a layout


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