
require "scripts/style"



function MakeTopBar()
  return Group {
    WidgetTopBar
      {        
        w=800, h=108, x=0, y=0,
        bg="widgets/topbar/uiFrame_top",

            Bitmap
            {
              name="infinite-lives",
              x=188, y=20,
              image="assets/widgets/topbar/infinity"
            },
            
            
            
            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "livestext",             
              x=188,y=20,w=35,h=30,
              flags = kHAlignRight + kVAlignCenter,			
              	
              Window
              {
                name = "sparkle-lives",
                x=0, y=0,              
              },
            },       

            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "scoretext",             
              x=48,y=22,w=82,h=28,
              flags = kHAlignCenter + kVAlignCenter,				              
            },       
        
            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "chemicaltext",             
              x=391,y=14,w=60,h=30,
              flags = kHAlignRight + kVAlignCenter,				
              Window
              {
                name = "sparkle-chemical",
                x=0, y=0,              
              },
            },       
            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "machinetext",              
              x=631,y=15,w=60,h=30,
              flags = kHAlignRight + kVAlignCenter,				
              Window
              {
                name = "sparkle-machine",
                x=0, y=0,              
              },
            },  
            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "monstertext",              
              x=513,y=18,w=60,h=30,
              flags = kHAlignRight + kVAlignCenter,				
              Window
              {
                name = "sparkle-monster",
                x=0, y=0,              
              },
            },  
            Text
            {
              -- this is the text of cash money
              font = WidgetFont,
              name = "cointext",             
              x=272,y=17,w=60,h=30,
              flags = kHAlignRight + kVAlignCenter,				
              Window
              {
                name = "sparkle-coins",
                x=0, y=0,              
              },
            },
            
            
            Window
            {
                name="timer",
                x=kMax-84, y=0, w=84, h=89,    
 -- set up all sub-images
                Window
                {
                  name = "sparkle-time",
                  x=30, y=40,              
                },
                AnimSprite
                {
                  name="timerbubble_bg",
                  x=49,y=48,-- from the center                                 
                  animations={
                    { key="allclear", texture="widgets/topbar/timer/timerbubble_bg", animation="main", default=1},                            
                    { key="redalert", texture="widgets/topbar/timer/timerbubble_bg", animation="redalert" },                            
                  },
                },    
                
                StateWindow 
                {
                  x=13, y=0,
                  w=75, h=85,
                  name="fluids",
                  default="green",
                  PercImage
                  { 
                    name="green",
                    x=0, y=28,
                    image="widgets/topbar/timer/timerbubble_fluid_green"
                  },
                  PercImage
                  { 
                    name="red",
                    x=0, y=28,
                    image="widgets/topbar/timer/timerbubble_fluid_red"
                  },
                },

                AnimSprite
                {
                  name='bubbles',
                  x=41,y=52,-- from the center                                 
                  animations={
                    { key="idle", texture="widgets/topbar/timer/timerbubbles", animation="main", default=1},                            
                  },
                },              

                
                PercImage
                {
                  name="cover",
                  x=11, y=28,
                  image="widgets/topbar/timer/timerbubble_bg_cover"
                },

                Bitmap
                {
                  x=11, y=0,
                  image="widgets/topbar/timer/timerbubble_glassframe"
                },


                          
            
            },
            
            
            
            AnimSprite
                {
                  name="ice",
                  x=760, y=59,  
                  animations={          
                    { key="idle", texture="widgets/topbar/timer/icetimer", animation="idle", default=1},
                    { key="frozen", texture="widgets/topbar/timer/icetimer", animation="frozen"},
                    { key="melt", texture="widgets/topbar/timer/icetimer", animation="melt"}, 
                  },                          
                },
            
            Bitmap
            {
              name="tiles-counter",
              x=8, y=40,
              image="widgets/topbar/tiles/tilecounter",
              Text
              {
                -- this is the text of cash money
                font = WidgetFont,
                name = "tiletext",              
                x=20,y=20,w=100,h=40,
                flags = kHAlignRight + kVAlignCenter,				
                Window
                {
                  name = "sparkle-tiles",
                  x=0, y=0,              
                },
              },  
            },  
            Bitmap
            {
              name="freeze-bonus",
              x=123, y=0,
              image="assets/widgets/topbar/2x"
            },           
   
            Bitmap
            {
              name="tooltip",
              image="widgets/topbar/tooltip-l",
              Text
              {
                x=10, y=0,
                w=kMax-10, h=kMax,
                font = {
                  standardFont,
                  14,
                  BlackColor
                },
                flags = kHAlignCenter + kVAlignCenter,
                name="tiptext",				                
              }
            }
            
         }  
      }
end
