View Single Post
  #2  
Unread 09-27-2010, 12:31 AM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
Quote:
Originally Posted by Olenn
Okay i am working on the Settings Panel for Satchel, and I was on a rollo until I the last time.

I am trying to make the slider change the opacity of the Satchel window. If I replace "Olenn.Satchel.SatchelWindow" with self it will successfully change the opacity of the settings window, but how do I get it to change the opacity of the Satchel window?

Code:
	self:SetText("Satchel Settings");
	self:SetSize(400, 500);
	self:SetPosition( (Turbine.UI.Display.GetWidth() / 2) - 200, (Turbine.UI.Display.GetHeight() / 2 ) - 325 );
	self:SetOpacity(1);
	

	self.opacityLabel = Turbine.UI.Label();
	self.opacityLabel:SetParent( self );
	self.opacityLabel:SetSize(100, 50);
	self.opacityLabel:SetPosition(50 , 75);
	self.opacityLabel:SetFont(Turbine.UI.Lotro.Font.Verdana18);
	self.opacityLabel:SetText("Opacity");		
	

	self.opacityScrollbar = Turbine.UI.Lotro.ScrollBar();
	self.opacityScrollbar:SetOrientation( Turbine.UI.Orientation.Horizontal );
	self.opacityScrollbar:SetParent( self );
	self.opacityScrollbar:SetSize( 300, 10 );
	self.opacityScrollbar:SetPosition(50,100);
	
	self.opacityScrollbar.ValueChanged = function( sender, args )
		Olenn.Satchel.SatchelWindow:SetOpacity( ( 55 + ( 200 - self.opacityScrollbar:GetValue() ) ) / 255 );
	end
It loosely follows a hierarchy. Normally I would start off with a "main" class that would contain all the individual elements (windows, panels etc). Then you can actually do something like this in your main class;

self.setupWindow.opacityScrollBar.ValueChanged=fun ction(sender,args)
self.SatchelWindow:SetOpacity(<val>);
end

that way you can make a "master" area where you can handle actions between different elements
__________________

Lord of the Rings Online
75 Fourohfour | 75 Artemedis | 60 Whiskeytango Foxtrot | 50 Mistah Boombastic | 56 Appetizer | 25 Aggromi
61 Onepointtwentyone Gigawatts


World of Warcraft
90 Downlo 85 Gravetaxi 85 Ümad 85 Artemedis 85 Guthuros
Reply With Quote