Post #1 · Posted at 2014-06-03 09:34:42pm 9.8 years ago
Th3_Ov3rHell_3XoduZ | |
---|---|
Member | |
313 Posts | |
Reg. 2012-09-13 | |
"ITG, The Best Dance Machine!" |
Last updated: 2014-06-04 05:48pm
Is there a way of make a code for display a Banner? via LUA?. Im having a lot of problems on that part, but If someone can help me, that would be great!
Thanks Anyway.
Post #2 · Posted at 2014-06-04 04:27:52am 9.8 years ago
local t = Def.ActorFrame{};
t[#t+1] =Def.Sprite {
InitCommand=cmd(x,SCREEN_LEFT+120;y,SCREEN_BOTTOM-140;rotationz,5;zoom,0.9;draworder,34);
CurrentSongChangedMessageCommand=cmd(finishtweening;queuecommand,"Banner");
BannerCommand=function(self)
self:stoptweening();
if GAMESTATE:GetCurrentSong() then
if GAMESTATE:GetCurrentSong():HasBanner() then
self:Load( GAMESTATE:GetCurrentSong():GetBannerPath() );
local graphicAspect = self:GetWidth()/self:GetHeight()
self:zoomto(60*graphicAspect,60)
else
self:Load( THEME:GetPathB("Common fallback","banner") );
local graphicAspect = self:GetWidth()/self:GetHeight()
self:zoomto(60*graphicAspect,60)
end;
else
Trace("[ScreenSelectMusic]:Not Song,so no Banner.");
end;
-- blablablablabla(other GUI commands)
end;
};
return t;
Copy these in a xx.lua,then load it as an actor.
e.g.:Write LoadActor("Banner"); in NetSelectMusic's default.lua
Post #3 · Posted at 2014-06-04 05:48:03pm 9.8 years ago
Th3_Ov3rHell_3XoduZ | |
---|---|
Member | |
313 Posts | |
Reg. 2012-09-13 | |
"ITG, The Best Dance Machine!" |
Quote: CrzP
local t = Def.ActorFrame{};
t[#t+1] =Def.Sprite {
InitCommand=cmd(x,SCREEN_LEFT+120;y,SCREEN_BOTTOM-140;rotationz,5;zoom,0.9;draworder,34);
CurrentSongChangedMessageCommand=cmd(finishtweening;queuecommand,"Banner");
BannerCommand=function(self)
self:stoptweening();
if GAMESTATE:GetCurrentSong() then
if GAMESTATE:GetCurrentSong():HasBanner() then
self:Load( GAMESTATE:GetCurrentSong():GetBannerPath() );
local graphicAspect = self:GetWidth()/self:GetHeight()
self:zoomto(60*graphicAspect,60)
else
self:Load( THEME:GetPathB("Common fallback","banner") );
local graphicAspect = self:GetWidth()/self:GetHeight()
self:zoomto(60*graphicAspect,60)
end;
else
Trace("[ScreenSelectMusic]:Not Song,so no Banner.");
end;
-- blablablablabla(other GUI commands)
end;
};
return t;
Copy these in a xx.lua,then load it as an actor.
e.g.:Write LoadActor("Banner"); in NetSelectMusic's default.lua
Omg, finally... Thanks u, this works... Now I have to edit the positions / etc but it works... THANKS U I will credit you later.
Post #4 · Posted at 2014-06-06 05:09:16am 9.8 years ago
CrzP | |
---|---|
Member | |
36 Posts | |
Reg. 2014-02-21 | |
Quote
Omg, finally... Thanks u, this works... Now I have to edit the positions / etc but it works... THANKS U Big Grin I will credit you later.
XD.Thanks.If you have more questions,just ask,I'll try my best~