Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
(04-07-2013, 17:23)SailorMoon Wrote:
Code:
SettingsTEXT()
{
self endon ( "disconnect" );

infosban = "TEXT";
infosban += "TEXT..";

infosban2 = "TEXT2";
infosban2 += "TEXT..";

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban2 );

}
I need this code to be in two separate functions
1)SettingsTEXT()

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban2 );

2)BanerText()

infosban = "TEXT";
infosban += "TEXT..";

infosban2 = "TEXT2";
infosban2 += "TEXT..";
Reply

#2
You can't use common temp variables in gscs, that's bad.

Code:
SettingsTEXT()
{
self endon ( "disconnect" );

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban(1) );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban(2) );

}

infosban(num)
{
       if(num==1)
          return "infosban1 BLABLABLA";
        else if(num==2)
           return "infosban2 AHAHAHA";

       return "undefined";
}
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.