lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 11-14-2011, 11:40 AM
Haupthir Haupthir is offline
The Wary
 
Join Date: Dec 2010
Posts: 4
How can i get a Button working?

I have created this butten:

Intro.SkirmWindow =Turbine.UI.Lotro.Button();
Intro.SkirmWindow:SetText(otherText[locale][6]);
Intro.SkirmWindow:SetPosition( 40, 40 );
Intro.SkirmWindow:SetSize( 150, 20 );
Intro.SkirmWindow:SetParent(Intro);

and i want that the button opens this window:

skirmWindow=Turbine.UI.Lotro.Window();
skirmWindow:SetSize(380,765);
skirmWindow:SetPosition(Turbine.UI.Display:GetWidt h()/2-190,Turbine.UI.Display:GetHeight()/2-300);
skirmWindow:SetText(otherText[locale][1]);

and it would be great if this window shuts down at the same time:

Intro=Turbine.UI.Lotro.Window();
Intro:SetSize(250,200);
Intro:SetPosition(Turbine.UI.Display:GetWidth()/2-190,Turbine.UI.Display:GetHeight()/2-300);
Intro:SetText(otherText[locale][5]);

Is this possible?

It would be great if somebody can help me.
Reply With Quote
  #2  
Unread 11-14-2011, 12:28 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Quote:
Originally Posted by Haupthir
I have created this butten:

Intro.SkirmWindow =Turbine.UI.Lotro.Button();
Intro.SkirmWindow:SetText(otherText[locale][6]);
Intro.SkirmWindow:SetPosition( 40, 40 );
Intro.SkirmWindow:SetSize( 150, 20 );
Intro.SkirmWindow:SetParent(Intro);

and i want that the button opens this window:

skirmWindow=Turbine.UI.Lotro.Window();
skirmWindow:SetSize(380,765);
skirmWindow:SetPosition(Turbine.UI.Display:GetWidt h()/2-190,Turbine.UI.Display:GetHeight()/2-300);
skirmWindow:SetText(otherText[locale][1]);

and it would be great if this window shuts down at the same time:

Intro=Turbine.UI.Lotro.Window();
Intro:SetSize(250,200);
Intro:SetPosition(Turbine.UI.Display:GetWidth()/2-190,Turbine.UI.Display:GetHeight()/2-300);
Intro:SetText(otherText[locale][5]);

Is this possible?

It would be great if somebody can help me.
To hide or show a window you use the :SetVisible() method.

To make a button perform an action, you assign a function to its MouseClick event.

For example, using the objects you originally posted:
Code:
skirmWindow=Turbine.UI.Lotro.Window(); 
skirmWindow:SetSize(380,765); 
skirmWindow:SetPosition(Turbine.UI.Display:GetWidth()/2-190,Turbine.UI.Display:GetHeight()/2-300); 
skirmWindow:SetText(otherText[locale][1]);
 
Intro=Turbine.UI.Lotro.Window(); 
Intro:SetSize(250,200); 
Intro:SetPosition(Turbine.UI.Display:GetWidth()/2-190,Turbine.UI.Display:GetHeight()/2-300); 
Intro:SetText(otherText[locale][5]);
 
Intro.SkirmWindow =Turbine.UI.Lotro.Button();
Intro.SkirmWindow:SetText(otherText[locale][6]);
Intro.SkirmWindow:SetPosition( 40, 40 );
Intro.SkirmWindow:SetSize( 150, 20 );
Intro.SkirmWindow:SetParent(Intro);
 
-- create the click event handler
Intro.SkirmWindow.MouseClick=function()
    skirmWindow:SetVisible(true); -- show the skirmWindow
    Intro:SetVisible(false); -- hide the Intro window
end
-- don't forget to make the Intro window visible initially (windows are not visible when created by default)
Intro:SetVisible(true);
Reply With Quote
  #3  
Unread 11-14-2011, 01:21 PM
Haupthir Haupthir is offline
The Wary
 
Join Date: Dec 2010
Posts: 4
Thanks, that helded me a lot

And how can turn the skirmWindow on and off with the Intro.SkirmWindow Butten.

I gess it works with and if, then funktion, but i cant get it working ...

May someone could help me again ...
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pressed button and mouse over button problem Marzio XML modification help (L) 3 09-24-2011 07:03 PM
Help with Turbine store button Krakenheim Interface Help (L) 5 09-10-2010 08:31 AM
I just want to know if it's *possible* to skin the greyed-out LI button. The Scyphozoa Interface Help (L) 1 03-15-2009 02:57 PM
Help Looking for the legendary menu button. Brygard2007 Graphics modification help (L) 12 11-29-2008 01:45 AM
Attack Button Kailvine LotRO Wish List (L) 2 09-05-2007 07:56 PM


All times are GMT -5. The time now is 02:48 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui