require("scripts/cpscript.lua");
require("scripts/styles/style.lua");

MakeState{

	BlgBitmap{
		image = "common/backgrounds/alpha_black",
		name = "mainmenuBG",
		center = {x = 0, y = 0},
	},
	
	BlgContainer{
		BlgMovieClip{
			transformMatrix = {x = 0, y = 0},

			SetStyle(WindowBGStyle),
			
			BlgMovieClip{
				repeatCount = 0,
				SetStyle(PalmTrunkStyle),
				BlgContainer{
					transformMatrix = {x = 700, y = 200},
					BlgBitmap {
						image="common/backgrounds/trunk",
						center = {x = 27, y = 122},
						transformMatrix = {x = 0, y = 0},
					},
					BlgBitmap {
						image = "common/backgrounds/hojas",
						center = {x = 90, y = 202},
						transformMatrix = {x = 0, y = 0},
					},
					
				},	
			},
			
				-- Graphic content
			SetStyle(WindowBGStyle),
			
			
			BlgBitmap {
				image="common/backgrounds/box_mainmenu",
				center = {x = 0, y = 0},
				transformMatrix = {x = 307, y = 174},
			},

			
--~ 			BlgMovieClip{
--~ 				SetStyle(LogoCircleStyle),
--~ 				repeatCount = -1,
--~ 				BlgBitmap{
--~ 					image = "common/backgrounds/logo_bg",
--~ 					name = "logo",
--~ 					center = {x = 0, y = 0},
--~ 					transformMatrix = {x = 19, y = 112},
--~ 				},
--~ 				SetStyle(nil),
--~ 				BlgBitmap{
--~ 					image = "common/backgrounds/logo_menu",
--~ 					name = "logo2",
--~ 					center = {x = 80, y = 32},
--~ 					playAnim = "DoAnim",
--~ 				},
--~ 			},
			

			SetStyle(Button1Style),
			
			BlgButton{
				transformMatrix = {x = 360, y = 216},
				label = "wnd_pause_resume",
				
				font = {
					standardFont,
					27,
					Color(182, 40, 154),
				},
				
				upState =
				{
					bitmap = "common/buttons/7_text_box1",
					text = {
						w=126, h=40,
						transformMatrix = {x = 127, y = 15 ,},
					},
				},
				overState = {
					bitmap = "common/buttons/6_text_box1_over",
					text = {
						w=126, h=40,
						transformMatrix = {x = 127, y = 15 ,},
					},
				},
				downState = {
					bitmap = "common/buttons/5_text_box1_down",
					text = {
						w=126, h=40,
						transformMatrix = {x = 127, y = 15 ,},
						
					},
					sound = kDefaultButtonSound,
				},
				command = function()
					PopState();
				end
			},

			SetStyle(Button2Style),
			BlgButton
			{
				transformMatrix = {x = 320, y =272},
				label = "wnd_pause_options",
				
				font = {
					standardFont,
					27,
					Color(182, 40, 154),
				},
				
				upState =
				{
					bitmap = "common/buttons/14_text_box4",
					text = {
						w=126, h=40,
						transformMatrix = {x = 204, y = 15 ,},
					},
				},
				overState = {
					bitmap = "common/buttons/13_text_box4_over",
					text = {
						w=126, h=40,
						transformMatrix = {x = 204, y = 15 ,},
					},
				},
				downState = {
					bitmap = "common/buttons/12_text_box4_down",
					text = {
						w=126, h=40,
						transformMatrix = {x = 204, y = 15 ,},
						
					},
					sound = kDefaultButtonSound,
				},
				command = function()
					PushState("scripts/states/stateoptions.lua");
				end
			},

			SetStyle(Button3Style),
			BlgButton
			{
				transformMatrix = {x = 324, y = 331},
				label = "wnd_pause_restart",
				font = {
					standardFont,
					27,
					Color(182, 40, 154),
				},
				upState =
				{
					bitmap = "common/buttons/11_text_box3",
					text = {
						w=126, h=40,
						transformMatrix = {x = 226, y = 11 ,},
					},
				},
				overState = {
					bitmap = "common/buttons/10_text_box3_over",
					text = {
						w=126, h=40,
						transformMatrix = {x = 226, y = 11 ,},
					},
				},
				downState = {
					bitmap = "common/buttons/9_text_box3_down",
					text = {
						w=126, h=40,
						transformMatrix = {x = 226, y = 11 ,},
						
					},
					sound = kDefaultButtonSound,
				},
				command = function()
					PopState();
					RestartLevel();
				end
			},

			SetStyle(Button4Style),
			BlgButton{
				transformMatrix = {x = 283, y = 387},
				label = "wnd_pause_levelselector",
				font = {
					standardFont,
					27,
					Color(182, 40, 154),
				},
				upState =
				{
					bitmap = "common/buttons/8_text_box2",
					text = {
						w=166, h=40,
						transformMatrix = {x = 221, y = 15 ,},
					},
				},
				overState = {
					bitmap = "common/buttons/7_text_box2_over",
					text = {
						w=166, h=40,
						transformMatrix = {x = 221, y = 15 ,},
					},
				},
				downState = {
					bitmap = "common/buttons/6_text_box2_down",
					text = {
						w=166, h=40,
						transformMatrix = {x = 221, y = 15 ,},
						
					},
					sound = kDefaultButtonSound,
				},
				command = function()
					PopState();
					ClearLevel();
					SwapToState("scripts/states/statelevelselector.lua");
				end
			},

			SetStyle(Button5Style),
			BlgButton{
				transformMatrix = {x = 321, y = 446},
				label = "wnd_pause_quit",
				font = {
					standardFont,
					27,
					Color(182, 40, 154),
				},
				upState =
				{
					bitmap = "common/buttons/5_text_box1",
					text = {
						w=126, h=40,
						transformMatrix = {x = 153, y = 15 ,},
					},
				},
				overState = {
					bitmap = "common/buttons/4_text_box1_over",
					text = {
						w=126, h=40,
						transformMatrix = {x = 153, y = 15 ,},
					},
				},
				downState = {
					bitmap = "common/buttons/3_text_box1_down",
					text = {
						w=126, h=40,
						transformMatrix = {x = 153, y = 15 ,},
						
					},
					sound = kDefaultButtonSound,
				},
				command = function()
					PopState();
					ClearLevel();
					SwapToState("scripts/states/statemainmenu.lua");
				end
			},
			
			SetStyle(WindowLogoStyle),
			BlgBitmap{
				image = "common/backgrounds/logo_01_big",
				name = "mainmenuBG",
				center = {x = 0, y = 0},
				transformMatrix = {x = 236, y = 185},
			},

			animation = nil,
		},
	}
};
