<data>
	<canvases>
		<!-- -->
		<!-- LANGUAGE MENU -->
		<!-- -->
		<canvas r_name="'kongLoader'" r_template="'mainCanvasTemplate'"
						r_graphic="'rngsdk.display.CdplSpriteSimple'"
						rw_frameCount="0"
						nextScreen="'logos'">
			<picture r_name="'kongLogo'" r_template="'mainPictureTemplate'" r_graphic="(globalParameters.w_fps>=40)?'KongLoader45.swf':'KongLoader30.swf'" r_scaleX="globalParameters.w_stageWidth/313" r_scaleY="globalParameters.w_stageHeight/226"/>
			<button r_name="'skip'" r_template="'mainButtonTemplate'"
							r_graphic="'vwInvisibleLayer'"
							r_width="globalParameters.w_stageWidth"
							r_height="globalParameters.w_stageHeight"
							r_keys="'any'"
							canSkip="rw_frameCount>(2*globalParameters.w_fps)">
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_enabled="canSkip" r_type="'ChangeScreen'" r_newScreen="nextScreen"/>
				<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"	r_enabled="!canSkip&&(w_userEvent!='KEY')" r_className="'CctlEffectOpenURL'" r_link="globalParameters.static.kongregate1QuestLink"/>
			</button>
			<event r_name="'onFrame'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_enabled="rw_frameCount>(4*globalParameters.w_fps)" r_type="'ChangeScreen'" r_newScreen="nextScreen"/>
			</event>
		</canvas>
		
		<canvas r_name="'logos'" r_template="'mainCanvasTemplate'"
						r_graphic="'rngsdk.display.CdplSpriteSimple'"
						rw_frameCount="0"
						r_alpha="min(20, rw_frameCount)/20"
						nextScreen="(globalParameters.textLib=='')?'languageSelection':'mainMenu'">
			<event r_name="'onFrame'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_enabled="rw_frameCount>61" r_type="'ChangeScreen'" r_newScreen="nextScreen"/>
			</event>
			<button r_name="'skip'" r_template="'mainButtonTemplate'"
							r_graphic="'vwBlackLayer'"
							r_width="globalParameters.w_stageWidth"
							r_height="globalParameters.w_stageHeight"
							r_keys="'any'">
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="nextScreen"/>
			</button>
			<canvas r_name="'verticalSizer'" r_template="'mainCanvasTemplate'" r_verticalSizer="globalParameters.w_stageHeight" r_centeredSizer="1" uniformScale="0.5*min(globalParameters.w_stageWidth/650, globalParameters.w_stageHeight/273)">
				<picture r_name="'rngPicture'" r_template="'mainPictureTemplate'" r_graphic="'logoRatzNGodz.png'" rw_xPos="(globalParameters.w_stageWidth-w_initialWidth*r_scaleX)/2" r_scaleX="uniformScale" r_scaleY="uniformScale"/>
				<picture r_name="'sbPicture'" r_template="'mainPictureTemplate'" r_graphic="'logoStorybird.png'" rw_xPos="(globalParameters.w_stageWidth-w_initialWidth*r_scaleX)/2" r_scaleX="uniformScale" r_scaleY="uniformScale"/>
			</canvas>
		</canvas>
		
		<canvas r_name="'languageSelection'" r_template="'mainCanvasTemplate'">
			<buttonTemplate r_name="'languageButtonTemplate'" r_template="'mainButtonTemplate'"
											r_width="100*globalParameters.screenPixelScale"
											r_height="100*globalParameters.screenPixelScale">
				<effect r_name="'changeTextLib'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="globalParameters.textLib=textLib"/>
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
			</buttonTemplate>
			<button r_name="'english'" r_template="'languageButtonTemplate'" textLib="'text'" r_graphic="'flagENon.png'" rw_xPos="globalParameters.w_stageWidth/2-r_width-20" rw_yPos="(globalParameters.w_stageHeight-r_height)/2"/>
			<button r_name="'french'" r_template="'languageButtonTemplate'" textLib="'textFR'" r_graphic="'flagFRon.png'" rw_xPos="globalParameters.w_stageWidth/2+20" rw_yPos="(globalParameters.w_stageHeight-r_height)/2"/>
		</canvas>		
		
		<!-- -->
		<!-- MAIN MENU -->
		<!-- -->
		<canvasTemplate r_name="'sequencer'" r_template="'mainCanvasTemplate'"
										rw_frameCount="0"
										frameStepToExecute="{}"
										loadingIcon="0">
			<event r_name="'frame'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<!-- active commands step by step to allow graphic refresh -->
				<effect r_name="'launchCommandeSequence'" r_template="{'mainSelfEffectTemplate','multiEffect'}"
								r_enabled="length(frameStepToExecute)>0"
								currentCommand="''">
					<effect r_name="'configureCurrent'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="currentCommand=((splice(frameStepToExecute,0,1))[0])"/>
					<effect r_name="'showLoading'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="currentCommand==r_name" r_effect="loadingIcon=1"/>
					<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'Refresh'"/>
					<effect r_name="'createMainWorld'" r_template="'mainSelfEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'NewWorld'" r_world="'mainWorld'"/>
					<effect r_name="'createChaosWorld'" r_template="'mainSelfEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'NewWorld'" r_world="'chaosWorld'"/>
					<effect r_name="'gotoNewGame'" r_template="'mainGraphicEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'ChangeScreen'" r_newScreen="'newGame'"/>
					<effect r_name="'loadWorld'" r_template="'mainSelfEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'LoadWorld'"/>
					<effect r_name="'gotoGame'" r_template="'mainGraphicEffectTemplate'" r_enabled="currentCommand==r_name" r_type="'ChangeScreen'" r_newScreen="'game'"/>
					<effect r_name="'checkWorldAndGotoGame'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="currentCommand==r_name">
						<effect r_name="'gotoGame'" r_template="'mainGraphicEffectTemplate'" r_enabled="exists(world)" r_type="'ChangeScreen'" r_newScreen="'game'"/>
						<effect r_name="'createGame'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="!exists(world)" r_effect="frameStepToExecute={(globalParameters.static.campaignModeAvailable&&!globalParameters.static.campaignModeLocked)?'createMainWorld':'createChaosWorld','gotoNewGame'}"/>
					</effect>
				</effect>
			</event>
			<picture r_name="'loadingIcon'" r_template="'mainPictureTemplate'" r_visible="loadingIcon" r_graphic="text.pictureLoading" rw_xPos="(globalParameters.w_stageWidth-w_initialWidth*r_scaleX)/2" rw_yPos="(globalParameters.w_stageHeight-w_initialHeight*r_scaleY)/2" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale" r_viewIndex="1">
				<event r_name="'loading'" r_template="'mainEventTemplate'" r_eventTarget="'loadingIcon'" r_targetType="'attribute'">
					<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
				</event>
			</picture>
		</canvasTemplate>
		<canvas r_name="'mainMenu'" r_template="'sequencer'"
						w_loaded="0"
						debugVisible="0">
			<event r_name="'music'" r_template="'mainEventTemplate'" r_eventTarget="'w_loaded'" r_targetType="'attribute'">
				<effect r_name="'launchMusic'" r_template="{'mainGraphicEffectTemplate','controllerEffect'}"
								r_enabled="w_loaded"
								r_className="'CctlEffectSound'"
								r_soundName="'1quest_menu.mp3'"
								r_music="1"/>
			</event>
			<picture r_name="'titlePicture'" r_template="'mainPictureTemplate'" r_graphic="'ecran_titre.png'" rw_xPos="0" rw_yPos="0" r_height="globalParameters.w_stageHeight" r_width="globalParameters.w_stageWidth"/>
			<picture r_name="'title'" r_template="'mainPictureTemplate'" r_graphic="'title1.png'" rw_xPos="min(globalParameters.w_stageWidth*0.75-w_initialWidth*r_scaleX*0.5,globalParameters.w_stageWidth-(w_initialWidth+50)*r_scaleX)" rw_yPos="max(10,globalParameters.w_stageHeight*0.20-w_initialHeight*r_scaleY*0.5)" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale"/>
			<canvas r_name="'verticalSizer'" r_template="'mainCanvasTemplate'" r_verticalSizer="240*effectiveScale" rw_yPos="globalParameters.w_stageHeight-20-40*globalParameters.screenPixelScale-r_verticalSizer" effectiveScale="globalParameters.screenScale">
				<canvasTemplate r_name="'mainMenuButtonTemplate'" r_template="'capsuleSimpleButtonTemplate'" rw_xPos="globalParameters.w_stageWidth-10-capsuleWidth" scale="effectiveScale" capsuleWidth="200*scale" capsuleHeight="50*scale">
					<text r_name="'capsuleText'" textSize="16*scale"/>
				</canvasTemplate>
				<canvas r_name="'campaign'" r_template="'mainMenuButtonTemplate'" capsuleText="(globalParameters.static.campaignModeLocked)?(text.lockedCampaign):(text.newCampaign)" r_visible="globalParameters.static.campaignModeAvailable">
					<button r_name="'capsuleButton'">
						<effect r_name="'configureSequence'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="!globalParameters.static.campaignModeLocked" r_effect="frameStepToExecute={'showLoading','refresh','createMainWorld','gotoNewGame'}"/>
						<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
										r_enabled="globalParameters.static.campaignModeLocked"
										r_className="'CctlEffectOpenURL'"
										r_link="globalParameters.static.kongregate1QuestLink"/>
					</button>
					<canvas r_name="'locked'" r_template="'mainCanvasTemplate'" r_visible="globalParameters.static.campaignModeLocked" r_graphic="'rngsdk.display.CdplSpriteSimple'">
						<picture r_name="'lock'" r_template="'mainPictureTemplate'" r_graphic="'lock.png'" rw_xPos="5" rw_yPos="5" r_width="capsuleHeight-10" r_height="capsuleHeight-10"/>
						<picture r_name="'kongregateIcon'" r_template="'mainPictureTemplate'" r_graphic="'kongregate.png'" rw_xPos="capsuleWidth-(5+r_width)" rw_yPos="5" r_width="capsuleHeight-10" r_height="capsuleHeight-10"/>
					</canvas>
				</canvas>
				<canvas r_name="'chaosTower'" r_template="'mainMenuButtonTemplate'" capsuleText="text.chaosTower">
					<button r_name="'capsuleButton'">
						<effect r_name="'configureSequence'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="!globalParameters.static.towerModeLocked" r_effect="frameStepToExecute={'showLoading','refresh','createChaosWorld','gotoNewGame'}"/>
						<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
										r_enabled="globalParameters.static.towerModeLocked"
										r_className="'CctlEffectOpenURL'"
										r_link="globalParameters.static.kongregate1QuestLink"/>
					</button>
					<canvas r_name="'locked'" r_template="'mainCanvasTemplate'" r_visible="globalParameters.static.towerModeLocked" r_graphic="'rngsdk.display.CdplSpriteSimple'">
						<picture r_name="'lock'" r_template="'mainPictureTemplate'" r_graphic="'lock.png'" rw_xPos="5" rw_yPos="5" r_width="capsuleHeight-10" r_height="capsuleHeight-10"/>
						<picture r_name="'kongregateIcon'" r_template="'mainPictureTemplate'" r_graphic="'kongregate.png'" rw_xPos="capsuleWidth-(5+r_width)" rw_yPos="5" r_width="capsuleHeight-10" r_height="capsuleHeight-10"/>
					</canvas>
				</canvas>
				<canvas r_name="'loadGame'" r_template="'mainMenuButtonTemplate'" capsuleText="text.loadGame">
					<button r_name="'capsuleButton'">
						<effect r_name="'configureSequence'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="frameStepToExecute=({'showLoading','refresh'}+(exists(world)?{}:{'loadWorld'})+{'checkWorldAndGotoGame'})"/>
					</button>
				</canvas>
				<canvas r_name="'quit'" r_template="'mainMenuButtonTemplate'" capsuleText="text.quit" r_visible="globalParameters.w_isAir">
					<button r_name="'capsuleButton'">
						<effect r_name="'quit'" r_template="'mainGraphicEffectTemplate'" r_type="'Quit'"/>
					</button>
				</canvas>
			</canvas>

			<button r_name="'settingsButton'" r_template="'mainButtonTemplate'" r_graphic="'settings.png'" rw_xPos="globalParameters.w_stageWidth-10-40*r_scaleY" rw_yPos="globalParameters.w_stageHeight-10-40*r_scaleY" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'settings'"/>
			</button>
			<button r_name="'achievementsButton'" r_template="'mainButtonTemplate'" r_graphic="'trophe_or.png'" rw_xPos="globalParameters.w_stageWidth-20-80*r_scaleY" rw_yPos="globalParameters.w_stageHeight-10-40*r_scaleY" r_width="40*r_scaleX" r_height="40*r_scaleY" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
				<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'achievements'"/>
			</button>
			
			<canvas r_name="'kongregate'" r_template="'mainCanvasTemplate'" r_visible="!globalParameters.w_isAir" r_graphic="'rngsdk.display.CdplSpriteSimple'" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-30*globalParameters.screenPixelScale-110">
				<text r_name="'MoreGames'" r_template="'mainTextFieldTemplate'" r_text="text.moreGamesOn" textSize="15" r_height="w_textHeight+4" r_width="152" r_textColor="16777215"/>
				<button r_name="'kongregate'" r_template="'mainButtonTemplate'" r_graphic="'kongregateBanner.gif'" rw_yPos="20">
					<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectOpenURL'" r_existingGraphic="globalParameters.static.kongregateLink"/>
				</button>
			</canvas>
			<button r_name="'android'" r_template="'mainButtonTemplate'" r_visible="!globalParameters.w_isAndroid||globalParameters.w_isFreeVersion" r_graphic="'android.png'" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-30*globalParameters.screenPixelScale-15-w_initialHeight*r_scaleY" r_scaleX="1" r_scaleY="1">
				<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
								r_className="'CctlEffectOpenURL'"
								r_link="globalParameters.static.android1QuestLink"/>
			</button>
			<button r_name="'twitterRNG'" r_template="'mainButtonTemplate'" r_graphic="'twitter.png'" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-10-30*r_scaleY" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
				<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
								r_className="'CctlEffectOpenURL'"
								r_link="'https://twitter.com/RatzNGodz'"/>
			</button>
			<text r_name="'version'" r_template="'mainTextFieldTemplate'" r_text="text.GameVersion" rw_xPos="20+30*globalParameters.screenPixelScale" rw_yPos="globalParameters.w_stageHeight-10-30*globalParameters.screenPixelScale" textSize="12*globalParameters.screenPixelScale" r_height="w_textHeight+4" r_width="w_textWidth+4" r_textColor="16777215"/>
			<button r_name="'muteButton'" r_template="'mainButtonTemplate'" r_graphic="(globalParameters.r_soundMusic)?'sound_on.png':'sound_off.png'" rw_xPos="globalParameters.w_stageWidth-w_initialWidth*r_scaleX-5" rw_yPos="5" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale">
				<effect r_name="'mute'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({globalParameters.r_soundMusic=!globalParameters.r_soundMusic,globalParameters.r_soundEffect=globalParameters.r_soundMusic})"/>
				<effect r_name="'soundRefresh'" r_template="'mainSoundEffectTemplate'" r_type="(globalParameters.r_soundMusic)?'LaunchMusic':'StopMusic'"/>
				<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
				<effect r_name="'paramSave'" r_template="'mainSelfEffectTemplate'" r_type="'SaveGlobalParameters'"/>
			</button>
			
			<!-- Debug -->
			<canvas r_name="'debugTemplate'" r_template="'capsuleSimpleButtonTemplate'" r_visible="debugVisible" capsuleText="'debug'" rw_xPos="0" rw_yPos="0" scale="1.5"/>
			<canvas r_name="'debug'" r_template="'debugTemplate'" capsuleText="'debug'">
				<button r_name="'capsuleButton'">
					<effect r_name="'changeScreen'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'debug'"/>
				</button>
			</canvas>
			<canvas r_name="'TU'" r_template="'debugTemplate'" capsuleText="'TU'" rw_xPos="0" rw_yPos="50">
				<button r_name="'capsuleButton'">
					<effect r_name="'TU'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectTU'" r_package="'rngsdk.debug'"/>
				</button>
			</canvas>
			<canvas r_name="'debugWorld'" r_template="'debugTemplate'" capsuleText="'DWorld'" rw_xPos="0" rw_yPos="100">
				<button r_name="'capsuleButton'">
					<effect r_name="'createWorld'" r_template="'mainSelfEffectTemplate'" r_type="'NewWorld'" r_world="'debugWorld'"/>
					<effect r_name="'setHeroParam'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({gameParameters.gender='Male',gameParameters.baseRace='Human',gameParameters.class='Rogue'})"/>
					<effect r_name="'createHero'" r_template="'createHeroCheatTemplate'"/>
					<effect r_name="'activation'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'game'"/>
				</button>
			</canvas>
			<canvas r_name="'layoutWorld'" r_template="'debugTemplate'" capsuleText="'Layout'" rw_xPos="0" rw_yPos="150">
				<button r_name="'capsuleButton'">
					<effect r_name="'createWorld'" r_template="'mainSelfEffectTemplate'" r_type="'NewWorld'" r_world="'layoutWorld'"/>
					<effect r_name="'setHeroParam'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({gameParameters.gender='Male',gameParameters.baseRace='Human',gameParameters.class='Warrior'})"/>
					<effect r_name="'createHero'" r_template="'createHeroCheatTemplate'"/>
					<effect r_name="'activation'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'game'"/>
				</button>
			</canvas>
			<canvas r_name="'monsterWorld'" r_template="'debugTemplate'" capsuleText="'Monsters'" rw_xPos="0" rw_yPos="200">
				<button r_name="'capsuleButton'">
					<effect r_name="'createWorld'" r_template="'mainSelfEffectTemplate'" r_type="'NewWorld'" r_world="'monsterWorld'"/>
					<effect r_name="'setHeroParam'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({gameParameters.gender='Male',gameParameters.baseRace='Human',gameParameters.class='Mage'})"/>
					<effect r_name="'createHero'" r_template="'createHeroCheatTemplate'"/>
					<effect r_name="'activation'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'game'"/>
				</button>
			</canvas>
			<canvas r_name="'directTest'" r_template="'debugTemplate'" capsuleText="'Direct'" rw_xPos="0" rw_yPos="250">
				<button r_name="'capsuleButton'">
					<effect r_name="'createWorld'" r_template="'mainSelfEffectTemplate'" r_type="'NewWorld'" r_world="'directWorld'"/>
					<effect r_name="'setHeroParam'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({gameParameters.gender='Female',gameParameters.baseRace='Orc',gameParameters.class='Rogue'})"/>
					<effect r_name="'setGameScreen'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="gameParameters.r_gameScreen='gameScreenMonoDungeon'"/>
					<effect r_name="'createHero'" r_template="'createHeroCheatTemplate'"/>
					<effect r_name="'activation'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'game'"/>
				</button>
			</canvas>
			<canvas r_name="'cheatEnabled'" r_template="'debugTemplate'" capsuleText="'Cheat'" rw_xPos="0" rw_yPos="300" selection="globalParameters.cheatEnabled">
				<button r_name="'capsuleButton'">
					<effect r_name="'cheatEnabled'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="globalParameters.cheatEnabled=!globalParameters.cheatEnabled"/>
				</button>
			</canvas>
			<button r_name="'debugVisible'" r_template="'mainButtonTemplate'" r_graphic="'vwInvisibleLayer'" r_width="32" r_height="32">
				<effect r_name="'debugVisible'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="globalParameters.w_debugVersion" r_effect="debugVisible=1"/>
				<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
			</button>
		</canvas>
		
		<!-- -->
		<!-- NEW GAME -->
		<!-- -->
		<!-- template -->
		<canvasTemplate r_name="'selectionButton'" r_template="'capsuleButtonTemplate'"
										capsuleText="parametersValue"
										capsuleEffect="all({settingEffect,newGameTooltip=tooltip})"
										activation="1"
										selection="parametersTarget==parametersValue"
										capsuleWidth="min(globalParameters.w_stageWidth*0.3,200*globalParameters.screenScale)"
										capsuleHeight="50*globalParameters.screenScale"
										scale="globalParameters.screenScale">
			<button r_name="'capsuleButton'">
				<event r_name="'isDown'">
					<effect r_name="'graphicRefresh'" r_type="'LocalRefresh'" r_refreshTarget="'newGame'" />
				</event>
			</button>
			<text r_name="'capsuleText'" textSize="20*globalParameters.screenScale"/>
		</canvasTemplate>
		<!-- screen -->
		<canvas r_name="'newGame'" r_template="'mainCanvasTemplate'"
						r_graphic="'rngsdk.display.CdplSpriteSimple'"
						newGameTooltip="text.tooltipNewGame">
			<picture r_name="'background'" r_template="'mainPictureTemplate'" r_graphic="'fond_creaperso.png'" r_width="globalParameters.w_stageWidth" r_height="globalParameters.w_stageHeight"/>
			<!-- Top -->
			<canvas r_name="'heroName'" r_template="'capsuleInputWithTextTemplate'"
							capsuleLabel="text.heroName"
							capsuleEffect="all({settingEffect,newGameTooltip=tooltip})"
							initialInputText="gameParameters.characterName"
							labelSize="80*globalParameters.screenScale"
							tooltip="text.tooltipName"
							settingEffect="gameParameters.characterName=inputText"
							rw_xPos="25"
							rw_yPos="25"
							capsuleWidth="min(globalParameters.w_stageWidth*0.3,200*globalParameters.screenScale)"
							capsuleHeight="50*globalParameters.screenScale"
							scale="globalParameters.screenScale">
				<input r_name="'capsuleInput'" textSize="20*globalParameters.screenScale"/>
				<text r_name="'capsuleLabel'" textSize="20*globalParameters.screenScale"/>
			</canvas>
			<canvas r_name="'male'" r_template="'selectionButton'" capsuleText="text.male" tooltip="''" settingEffect="gameParameters.gender='Male'" selection="gameParameters.gender=='Male'" rw_xPos="globalParameters.w_stageWidth-2*(capsuleWidth+25)" rw_yPos="25"/>
			<canvas r_name="'female'" r_template="'selectionButton'" capsuleText="text.female" tooltip="''" settingEffect="gameParameters.gender='Female'" selection="gameParameters.gender=='Female'" rw_xPos="globalParameters.w_stageWidth-(capsuleWidth+25)" rw_yPos="25"/>

			<!-- Selection Zone -->
			<canvas r_name="'sizer'" r_template="'mainCanvasTemplate'"
							rw_xPos="(globalParameters.w_stageWidth-r_horizontalSizer)/2"
							r_horizontalSizer="600*globalParameters.screenScale"
							r_centeredSizer="1">
				<canvasTemplate r_name="'cardSelectionButton'" r_template="'mainCanvasTemplate'"
												r_graphic="'rngsdk.display.CdplSpriteSimple'"
												rw_yPos="50+50*globalParameters.screenScale"
												cardName="''"
												cardType="''"
												tooltip="text.(attributeByName('tooltip'+cardName))"
												index="0"
												cardWidth="138*1.3"
												cardHeight="206*1.3">
					<buttonTemplate r_name="'arrowTemplate'" r_template="'mainButtonTemplate'"
									rw_yPos="(cardHeight*globalParameters.screenScale-32*r_scaleY)/2"
									r_scaleX="globalParameters.screenPixelScale*2"
									r_scaleY="globalParameters.screenPixelScale*2"
									arrowEffect="">
						<effect r_name="'arrowEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="arrowEffect"/>
						<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
					</buttonTemplate>
					<button r_name="'leftArrow'" r_template="'arrowTemplate'" r_graphic="'f_leftBig'" rw_xPos="-20*r_scaleX" arrowEffect="all({index=(index+(maxIndex-1))%maxIndex,setEffect})"/>
					<button r_name="'rightArrow'" r_template="'arrowTemplate'" r_graphic="'f_rightBig'" rw_xPos="cardWidth*globalParameters.screenScale" arrowEffect="all({index=(index+1)%maxIndex,setEffect})"/>
					<button r_name="'cardPicture'" r_template="'mainButtonTemplate'" r_graphic="'IHM_'+lower(cardName)+'.png'" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale" r_width="cardWidth*globalParameters.screenScale" r_height="cardHeight*globalParameters.screenScale">
						<effect r_name="'tooltip'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="newGameTooltip=tooltip"/>
						<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
					</button>
					<text r_name="'cardName'" r_template="'mainTextFieldTemplate'" r_text="text.(attributeByName(cardType+cardName))" textSize="20*globalParameters.screenScale" r_width="cardWidth*globalParameters.screenScale" r_height="w_textHeight+4" r_align="'center'" rw_yPos="(cardHeight-10)*globalParameters.screenScale-r_height"/>
				</canvasTemplate>
				
				<canvas r_name="'raceCard'" r_template="'cardSelectionButton'"
								raceList="globalParameters.static.raceList"
								setEffect="all({gameParameters.baseRace=raceList[index],newGameTooltip=tooltip})"
								cardName="gameParameters.baseRace"
								cardType="'race'"
								maxIndex="length(raceList)"/>
				<canvas r_name="'classCard'" r_template="'cardSelectionButton'"
								classList="globalParameters.static.classList"
								setEffect="all({gameParameters.class=classList[index],newGameTooltip=tooltip})"
								cardName="gameParameters.class"
								cardType="'class'"
								maxIndex="length(classList)"/>
			</canvas>
			
			<!-- Bottom -->
			<canvas r_name="'sizerDifficulty'" r_template="'mainCanvasTemplate'"
							rw_xPos="(globalParameters.w_stageWidth-r_horizontalSizer)/2"
							r_horizontalSizer="600*globalParameters.screenScale"
							r_centeredSizer="1">
				<canvasTemplate r_name="'difficultyTemplate'" r_template="'selectionButton'" difficulty="0" settingEffect="all({globalParameters.baseDifficulty=difficulty,gameParameters.difficulty=difficulty})" selection="gameParameters.difficulty==difficulty" rw_yPos="globalParameters.w_stageHeight-150*globalParameters.screenScale-20"	capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale"/>
				<canvas r_name="'easy'" r_template="'difficultyTemplate'" difficulty="0" capsuleText="text.difficultyEasy" tooltip="text.tooltipEasy" rw_xPos="25" />
				<canvas r_name="'normal'" r_template="'difficultyTemplate'" difficulty="1" capsuleText="text.difficultyNormal" tooltip="text.tooltipNormal" rw_xPos="50+capsuleWidth"/>
			</canvas>
			
			<canvas r_name="'startGame'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.start" rw_xPos="25" rw_yPos="globalParameters.w_stageHeight-100*globalParameters.screenScale-10" capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale" scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'" r_enabled="activation">
					<effect r_name="'paramSave'" r_template="'mainSelfEffectTemplate'" r_type="'SaveGlobalParameters'"/>
					<effect r_name="'createHero'" r_template="'createHeroTemplate'"/>
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_enabled="world.isCampaign" r_type="'ChangeScreen'" r_newScreen="'introduction'"/>
					<effect r_name="'gotoMonoDungeonGame'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="!world.isCampaign">
						<effect r_name="'setGameScreen'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="gameParameters.r_gameScreen='gameScreenMonoDungeon'"/>
						<effect r_name="'gotoGame'" r_template="'mainGraphicEffectTemplate'" r_enabled="exists(world)" r_type="'ChangeScreen'" r_newScreen="'game'"/>
					</effect>
				</button>
				<text r_name="'capsuleText'" textSize="20*globalParameters.screenScale"/>
			</canvas>
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.return" capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale" rw_xPos="25" rw_yPos="globalParameters.w_stageHeight-40*globalParameters.screenScale-10" scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'removeWorld'" r_template="'mainSelfEffectTemplate'" r_type="'RemoveWorld'"/>
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
				</button>
				<text r_name="'capsuleText'" textSize="20*globalParameters.screenScale"/>
			</canvas>
			<canvas r_name="'tooltip'" r_template="'capsuleDarkTextTemplate'" capsuleText="newGameTooltip" capsuleWidth="globalParameters.w_stageWidth-160*globalParameters.screenScale-75" capsuleHeight="100*globalParameters.screenScale" rw_xPos="160*globalParameters.screenScale+50" rw_yPos="globalParameters.w_stageHeight-100*scale-10" scale="globalParameters.screenScale">
				<text r_name="'capsuleText'" textSize="20*globalParameters.screenScale"/>
			</canvas>
		</canvas>
		
		
		<!-- -->
		<!-- SETTINGS -->
		<!-- -->
		<canvas r_name="'settings'" r_template="'mainCanvasTemplate'"
						r_graphic="'rngsdk.display.CdplSpriteSimple'"
						isScreen="1"
						labelWidth="min(globalParameters.w_stageWidth*0.25,150*globalParameters.screenScale)"
						labelHeight="min(globalParameters.w_stageHeight*0.12,40*globalParameters.screenScale)"
						r_mouseEnabled="1">
			<picture r_name="'background'" r_template="'mainPictureTemplate'" r_graphic="'fond_creaperso.png'" r_width="globalParameters.w_stageWidth" r_height="globalParameters.w_stageHeight"/>
			<canvas r_name="'vSizer'" r_template="'verticalSizedMaskedZone'"
							rw_yPos="10"
							minimumSize="9*40*globalParameters.screenScale+40"
							idealSize="9*50*globalParameters.screenScale+80"
							maximumSize="globalParameters.w_stageHeight-30-40*globalParameters.screenScale"
							innerWidth="globalParameters.w_stageWidth">
				<canvas r_name="'draggedZone'"
								r_maskInnerWidth="innerWidth">
					<canvas r_name="'sizer'">
						<canvasTemplate r_name="'SettingsTemplate'" r_template="'mainCanvasTemplate'" r_graphic="'rngsdk.display.CdplSpriteSimple'" rw_xPos="10">
							<buttonTemplate r_name="'soundModificationButton'" r_template="'mainButtonTemplate'" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
								<effect r_name="'soundModification'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="buttonEffect"/>
								<effect r_name="'soundRefresh'" r_template="'mainSoundEffectTemplate'" r_type="'UpdateVolume'"/>
								<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
							</buttonTemplate>
							<canvasTemplate r_name="'LabelTemplate'" r_template="'capsuleDarkTextTemplate'" scale="globalParameters.screenScale" capsuleWidth="labelWidth" capsuleHeight="labelHeight" centeredText="1">
								<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
							</canvasTemplate>
						</canvasTemplate>
			
						<!-- UIScale -->
						<canvas r_name="'UISize'" r_template="'SettingsTemplate'">
							<canvas r_name="'UISizeLabel'" r_template="'LabelTemplate'" capsuleText="text.UISize"/>
							<canvas r_name="'hMask'" r_template="'horizontalSizedMaskedZone'"
											rw_xPos="30+labelWidth"
											minimumSize="8*70*globalParameters.screenScale"
											idealSize="8*70*globalParameters.screenScale+100"
											maximumSize="globalParameters.w_stageWidth-labelWidth-40"
											innerHeight="50*globalParameters.screenScale">
								<canvas r_name="'draggedZone'">
									<canvas r_name="'sizer'">
										<canvasTemplate r_name="'UISizeButtonTemplate'" r_template="'capsuleButtonTemplate'"
																		r_visible="globalParameters.w_stageWidth>=(400*UIScale)"
																		capsuleEffect="globalParameters.UIScaleSettings=UIScale"
																		capsuleText="''+UIScale"
																		capsuleWidth="70*globalParameters.screenScale"
																		capsuleHeight="40*globalParameters.screenScale"
																		scale="globalParameters.screenScale"
																		selection="globalParameters.UIScaleSettings==UIScale">
											<button r_name="'capsuleButton'">
												<event r_name="'isDown'">
													<effect r_name="'graphicRefresh'" r_type="'Refresh'"/>
												</event>
											</button>
											<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
										</canvasTemplate>
										<canvas r_name="'UI_Auto'" r_template="'UISizeButtonTemplate'" UIScale="0" capsuleText="text.auto"/>
										<canvas r_name="'UI_1'" r_template="'UISizeButtonTemplate'" UIScale="1"/>
										<canvas r_name="'UI_1_5'" r_template="'UISizeButtonTemplate'" UIScale="1.5"/>
										<canvas r_name="'UI_2'" r_template="'UISizeButtonTemplate'" UIScale="2"/>
										<canvas r_name="'UI_2_5'" r_template="'UISizeButtonTemplate'" UIScale="2.5"/>
										<canvas r_name="'UI_3'" r_template="'UISizeButtonTemplate'" UIScale="3"/>
										<canvas r_name="'UI_3_5'" r_template="'UISizeButtonTemplate'" UIScale="3.5"/>
										<canvas r_name="'UI_4'" r_template="'UISizeButtonTemplate'" UIScale="4"/>
									</canvas>
								</canvas>
							</canvas>
						</canvas>
						
						<!-- Fullscreen -->
						<canvas r_name="'fullscreenButton'" r_template="'capsuleButtonTemplate'"
										r_visible="globalParameters.w_isAir&&!globalParameters.isMobile"
										capsuleText="text.fullscreen"
										capsuleEffect="globalParameters.r_fullscreen=!globalParameters.r_fullscreen"
										capsuleWidth="2*labelWidth"
										capsuleHeight="labelHeight"
										selection="globalParameters.r_fullscreen"
										rw_xPos="10"
										scale="globalParameters.screenScale">
							<button r_name="'capsuleButton'">
								<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
							</button>
							<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
						</canvas>
						
						<!-- CPU Rendering -->
						<canvas r_name="'forceCPURendering'" r_template="'SettingsTemplate'" r_visible="isScreen">
							<canvas r_name="'forceCPURenderingLabel'" r_template="'LabelTemplate'" capsuleText="text.forceCPURendering"/>
							<canvas r_name="'forceCPURendering'" r_template="'capsuleButtonTemplate'"
											r_visible="globalParameters.w_GPUAvailable"
											capsuleText="text.CPU"
											capsuleEffect="globalParameters.r_forceCPURendering=1"
											capsuleWidth="100*globalParameters.screenScale"
											capsuleHeight="labelHeight"
											selection="globalParameters.r_forceCPURendering"
											rw_xPos="30+labelWidth"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
								</button>
								<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
							</canvas>
							<canvas r_name="'forceGPURendering'" r_template="'capsuleButtonTemplate'"
											r_visible="globalParameters.w_GPUAvailable"
											capsuleText="text.GPU"
											capsuleEffect="globalParameters.r_forceCPURendering=0"
											capsuleWidth="100*globalParameters.screenScale"
											capsuleHeight="labelHeight"
											selection="!globalParameters.r_forceCPURendering"
											rw_xPos="40+labelWidth+100*globalParameters.screenScale"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
								</button>
								<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
							</canvas>
							<text r_name="'GPUNotAvailable'" r_template="'mainTextFieldTemplate'"
										r_visible="!globalParameters.w_GPUAvailable"
										r_text="text.GPUNotAvailable"
										textSize="18*globalParameters.screenScale"
										r_width="w_textWidth+4"
										r_height="w_textHeight+4"
										rw_xPos="30+labelWidth"
										rw_yPos="10"
										r_textColor="16777215"/>
							<canvas r_name="'nexus10Mode'" r_template="'capsuleButtonTemplate'"
											capsuleText="text.nexus10Mode"
											capsuleEffect="globalParameters.r_nexus10Mode=!globalParameters.r_nexus10Mode"
											capsuleWidth="100*globalParameters.screenScale"
											capsuleHeight="labelHeight"
											selection="globalParameters.r_nexus10Mode"
											rw_xPos="50+labelWidth+200*globalParameters.screenScale"
											scale="globalParameters.screenScale">
							</canvas>										
						</canvas>

						<canvas r_name="'logParameters'" r_template="'mainCanvasTemplate'" r_graphic="'rngsdk.display.CdplSpriteSimple'">
							<canvas r_name="'logLightButton'" r_template="'capsuleButtonTemplate'"
											capsuleText="(globalParameters.logLight)?(text.logMethodLight):(text.logMethodFull)"
											capsuleEffect="globalParameters.logLight=!globalParameters.logLight"
											capsuleWidth="2*labelWidth"
											capsuleHeight="labelHeight"
											rw_xPos="10"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
								</button>
								<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
							</canvas>
							
							<canvas r_name="'showTooltipButton'" r_template="'capsuleButtonTemplate'"
											capsuleText="text.showTooltip"
											capsuleEffect="globalParameters.showTooltip=!globalParameters.showTooltip"
											capsuleWidth="2*labelWidth"
											capsuleHeight="labelHeight"
											rw_xPos="20+capsuleWidth"
											scale="globalParameters.screenScale"
											selection="globalParameters.showTooltip">
								<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
							</canvas>
						</canvas>

						<canvas r_name="'defaultAutoPexButton'" r_template="'capsuleButtonTemplate'"
										capsuleText="text.defaultAutoPex"
										capsuleEffect="globalParameters.defaultAutoXP=!globalParameters.defaultAutoXP"
										capsuleWidth="2*labelWidth"
										capsuleHeight="labelHeight"
										rw_xPos="10"
										scale="globalParameters.screenScale"
										selection="globalParameters.defaultAutoXP">
							<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
						</canvas>
						
						<!-- Language -->
						<canvas r_name="'language'" r_template="'SettingsTemplate'">
							<canvas r_name="'languageLabel'" r_template="'LabelTemplate'" capsuleText="text.language"/>
							<buttonTemplate r_name="'languageButtonTemplate'" r_template="'mainButtonTemplate'"
															r_scaleX="2*globalParameters.screenPixelScale"
															r_scaleY="2*globalParameters.screenPixelScale">
								<effect r_name="'changeTextLib'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="globalParameters.textLib=textLib"/>
								<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
							</buttonTemplate>
							<button r_name="'english'" r_template="'languageButtonTemplate'" textLib="'text'" rw_xPos="labelWidth+40" r_graphic="(globalParameters.textLib=='text')?'flagENon.png':'flagENoff.png'"/>
							<button r_name="'french'" r_template="'languageButtonTemplate'" textLib="'textFR'" rw_xPos="labelWidth+50+80*globalParameters.screenPixelScale" r_graphic="(globalParameters.textLib=='textFR')?'flagFRon.png':'flagFRoff.png'"/>
						</canvas>
				
						<!-- Sound (Music) -->
						<canvas r_name="'SoundMusic'" r_template="'SettingsTemplate'">
							<canvas r_name="'SoundMusicLabel'" r_template="'LabelTemplate'" capsuleText="text.music"/>
							<button r_name="'muteButton'" r_template="'mainButtonTemplate'" r_graphic="(globalParameters.r_soundMusic)?'music_on.png':'music_off.png'" rw_xPos="labelWidth+50" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
								<effect r_name="'mute'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="globalParameters.r_soundMusic=!globalParameters.r_soundMusic"/>
								<effect r_name="'soundRefresh'" r_template="'mainSoundEffectTemplate'" r_type="(globalParameters.r_soundMusic)?'LaunchMusic':'StopMusic'"/>
								<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
							</button>
							<button r_name="'SoundMusicMinus'" r_template="'soundModificationButton'" r_graphic="'button_down.png'" buttonEffect="(globalParameters.r_soundMusicVolume>0.05)?(globalParameters.r_soundMusicVolume-=0.1):(globalParameters.r_soundMusicVolume=0)" rw_xPos="labelWidth+70*globalParameters.screenPixelScale+50" rw_yPos="8*globalParameters.screenPixelScale"/>
							<text r_name="'SoundMusicVolume'" r_template="'mainTextFieldTemplate'" r_text="round(globalParameters.r_soundMusicVolume*100)+'%'" textSize="15*globalParameters.screenPixelScale" r_width="40*globalParameters.screenPixelScale" r_height="w_textHeight+4" r_align="'right'" rw_xPos="labelWidth+110*globalParameters.screenPixelScale+60" rw_yPos="(40*globalParameters.screenPixelScale-w_textHeight-4)/2"/>
							<button r_name="'SoundMusicPlus'" r_template="'soundModificationButton'" r_graphic="'button_up.png'" buttonEffect="(0.95>globalParameters.r_soundMusicVolume)?(globalParameters.r_soundMusicVolume+=0.1):(globalParameters.r_soundMusicVolume=1)" rw_xPos="labelWidth+150*globalParameters.screenPixelScale+70" rw_yPos="8*globalParameters.screenPixelScale"/>
						</canvas>
			
						<!-- Sound (effect) -->
						<canvas r_name="'SoundEffect'" r_template="'SettingsTemplate'">
							<canvas r_name="'SoundEffectLabel'" r_template="'LabelTemplate'" capsuleText="text.effect"/>
							<button r_name="'muteButton'" r_template="'mainButtonTemplate'" r_graphic="(globalParameters.r_soundEffect)?'sound_on.png':'sound_off.png'" rw_xPos="labelWidth+50" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale">
								<effect r_name="'mute'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="globalParameters.r_soundEffect=!globalParameters.r_soundEffect"/>
								<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
							</button>
							<button r_name="'SoundEffectMinus'" r_template="'soundModificationButton'" r_graphic="'button_down.png'" buttonEffect="(globalParameters.r_soundEffectVolume>0.05)?(globalParameters.r_soundEffectVolume-=0.1):(globalParameters.r_soundEffectVolume=0)" rw_xPos="labelWidth+70*globalParameters.screenPixelScale+50" rw_yPos="8*globalParameters.screenPixelScale"/>
							<text r_name="'SoundEffectVolume'" r_template="'mainTextFieldTemplate'" r_text="round(globalParameters.r_soundEffectVolume*100)+'%'" textSize="15*globalParameters.screenPixelScale" r_width="40*globalParameters.screenPixelScale" r_height="w_textHeight+4" r_align="'right'" rw_xPos="labelWidth+110*globalParameters.screenPixelScale+60" rw_yPos="(40*globalParameters.screenPixelScale-w_textHeight-4)/2"/>
							<button r_name="'SoundEffectPlus'" r_template="'soundModificationButton'" r_graphic="'button_up.png'" buttonEffect="(0.95>globalParameters.r_soundEffectVolume)?(globalParameters.r_soundEffectVolume+=0.1):(globalParameters.r_soundEffectVolume=1)" rw_xPos="labelWidth+150*globalParameters.screenPixelScale+70" rw_yPos="8*globalParameters.screenPixelScale"/>
						</canvas>
						
						<!-- Support -->
						<canvas r_name="'supportButton'" r_template="'capsuleButtonTemplate'"
										r_visible="globalParameters.w_debugVersion"
										capsuleText="text.reportBug"
										capsuleEffect=""
										capsuleWidth="2*labelWidth"
										capsuleHeight="labelHeight"
										rw_xPos="10"
										scale="globalParameters.screenScale">
							<button r_name="'capsuleButton'">
								<effect r_name="'sendMail'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
												r_className="'CctlEffectSendMail'"
												r_subject="text.bugReportSubject"
												r_body="text.bugReportbody"/>
							</button>
						</canvas>

						<!-- show console -->
						<canvas r_name="'showConsoleCanvas'" r_template="'mainCanvasTemplate'"
										r_graphic="'rngsdk.display.CdplSpriteSimple'"
										r_visible="globalParameters.w_debugVersion">
							<canvas r_name="'showConsoleButton'" r_template="'capsuleButtonTemplate'"
											capsuleText="text.showConsole"
											capsuleEffect="globalParameters.r_showConsole=!globalParameters.r_showConsole"
											capsuleWidth="1.5*labelWidth"
											capsuleHeight="labelHeight"
											selection="globalParameters.r_showConsole"
											rw_xPos="10"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
								</button>
							</canvas>
							<canvas r_name="'showFPSButton'" r_template="'capsuleButtonTemplate'"
											capsuleText="text.showFPS"
											capsuleEffect="globalParameters.r_showFPS=!globalParameters.r_showFPS"
											capsuleWidth="1.5*labelWidth"
											capsuleHeight="labelHeight"
											selection="globalParameters.r_showFPS"
											rw_xPos="1.5*labelWidth+20"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'globalRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
								</button>
							</canvas>
							<canvas r_name="'cleanConsole'" r_template="'capsuleButtonTemplate'"
											capsuleText="text.cleanConsole"
											capsuleWidth="1.5*labelWidth"
											capsuleHeight="labelHeight"
											rw_xPos="3*labelWidth+30"
											scale="globalParameters.screenScale">
								<button r_name="'capsuleButton'">
									<effect r_name="'clean'" r_template="'mainSelfEffectTemplate'" r_type="'CleanConsole'"/>
								</button>
							</canvas>
						</canvas>
					</canvas>
				</canvas>
			</canvas>
			
			<!-- Return -->
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.return" capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-40*globalParameters.screenScale-10" scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}" r_enabled="isScreen||isSettingsOpen">
					<effect r_name="'paramSave'" r_template="'mainSelfEffectTemplate'" r_type="'SaveGlobalParameters'"/>
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_enabled="isScreen" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
					<effect r_name="'resumeGame'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="!isScreen">
						<effect r_name="'resumeGame'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({isSettingsOpen=0,isPaused=0})"/>
						<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
					</effect>
				</button>
				<text r_name="'capsuleText'" textSize="18*globalParameters.screenScale"/>
			</canvas>
		</canvas>

		<!-- -->
		<!-- ACHIEVEMENTS -->
		<!-- -->
		<canvas r_name="'achievements'" r_template="'mainCanvasTemplate'" r_graphic="'rngsdk.display.CdplSpriteSimple'">
			<picture r_name="'background'" r_template="'mainPictureTemplate'" r_graphic="'fond_creaperso.png'" r_width="globalParameters.w_stageWidth" r_height="globalParameters.w_stageHeight"/>

			<canvas r_name="'achievementsZone'" r_template="'verticalSizedMaskedZone'"
							minimumSize="(2*184+6*88)*globalParameters.screenScale+7*10"
							idealSize="minimumSize"
							maximumSize="globalParameters.w_stageHeight-40*globalParameters.screenScale-30"
							innerWidth="globalParameters.w_stageWidth-20"
							rw_yPos="10"
							rw_xPos="10">
				<canvas r_name="'draggedZone'">
					<canvas r_name="'sizer'">
							
						<!-- Achievement template -->
						<canvasTemplate r_name="'achievement1Template'" r_template="'mainCanvasTemplate'"
														r_graphic="'rngsdk.display.CdplSpriteSimple'" 
														condition1="0"
														condition2="0"
														condition3="0"
														text1="''">
							<picture r_name="'left'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe1_left.png'" rw_xPos="0" rw_yPos="0" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'center'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe1_center.png'" rw_xPos="99*globalParameters.screenScale" rw_yPos="0" r_width="globalParameters.w_stageWidth-20-198*globalParameters.screenScale" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'right'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe1_right.png'" rw_xPos="globalParameters.w_stageWidth-20-100*globalParameters.screenScale" rw_yPos="0" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'trophy1'" r_template="'mainPictureTemplate'" r_graphic="condition1?(condition2?(condition3?'trophe_or.png':'trophe_silver.png'):'trophe_bronze.png'):'trophe_gris.png'" r_alpha="condition1?1:0.5" r_visible="1" rw_xPos="28*globalParameters.screenScale+w_initialWidth*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" rw_yPos="27*globalParameters.screenScale+w_initialHeight*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale"/>
							<text r_name="'text1'" r_template="'mainTextFieldTemplate'" r_text="text1" textSize="10*globalParameters.UIScale" rw_xPos="66*globalParameters.screenScale" rw_yPos="31*globalParameters.screenScale" r_width="globalParameters.w_stageWidth-20-rw_xPos"/>
						</canvasTemplate>
						
						<canvasTemplate r_name="'achievement3Template'" r_template="'mainCanvasTemplate'"
														r_graphic="'rngsdk.display.CdplSpriteSimple'" 
														condition1="0"
														condition2="0"
														condition3="0"
														text1="''"
														text2="''"
														text3="''">
							<picture r_name="'left'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe_left.png'" rw_xPos="0" rw_yPos="0" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'center'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe_center.png'" rw_xPos="99*globalParameters.screenScale" rw_yPos="0" r_width="globalParameters.w_stageWidth-20-198*globalParameters.screenScale" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'right'" r_template="'mainPictureTemplate'" r_graphic="'cadre_trophe_right.png'" rw_xPos="globalParameters.w_stageWidth-20-100*globalParameters.screenScale" rw_yPos="0" r_scaleX="globalParameters.screenScale" r_scaleY="globalParameters.screenScale"/>
							<picture r_name="'trophy1'" r_template="'mainPictureTemplate'" r_graphic="condition1?'trophe_bronze.png':'trophe_gris.png'" r_alpha="condition1?1:0.5" r_visible="1" rw_xPos="28*globalParameters.screenScale+w_initialWidth*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" rw_yPos="27*globalParameters.screenScale+w_initialHeight*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale"/>
							<text r_name="'text1'" r_template="'mainTextFieldTemplate'" r_text="text1" textSize="10*globalParameters.UIScale" rw_xPos="66*globalParameters.screenScale" rw_yPos="31*globalParameters.screenScale" r_width="globalParameters.w_stageWidth-20-rw_xPos"/>
							<picture r_name="'trophy2'" r_template="'mainPictureTemplate'" r_graphic="condition2?'trophe_argent.png':'trophe_gris.png'" r_alpha="condition2?1:0.5" r_visible="condition1" rw_xPos="28*globalParameters.screenScale+w_initialWidth*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" rw_yPos="75*globalParameters.screenScale+w_initialHeight*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale"/>
							<text r_name="'text2'" r_template="'mainTextFieldTemplate'" r_visible="condition1" r_text="text2" textSize="10*globalParameters.UIScale" rw_xPos="66*globalParameters.screenScale" rw_yPos="79*globalParameters.screenScale" r_width="globalParameters.w_stageWidth-20-rw_xPos"/>
							<picture r_name="'trophy3'" r_template="'mainPictureTemplate'" r_graphic="condition3?'trophe_or.png':'trophe_gris.png'" r_alpha="condition3?1:0.5" r_visible="condition2" rw_xPos="28*globalParameters.screenScale+w_initialWidth*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" rw_yPos="124*globalParameters.screenScale+w_initialHeight*(globalParameters.screenScale-globalParameters.screenPixelScale)*0.5" r_scaleX="globalParameters.screenPixelScale" r_scaleY="globalParameters.screenPixelScale"/>
							<text r_name="'text3'" r_template="'mainTextFieldTemplate'" r_visible="condition2" r_text="text3" textSize="10*globalParameters.UIScale" rw_xPos="66*globalParameters.screenScale" rw_yPos="128*globalParameters.screenScale" r_width="globalParameters.w_stageWidth-20-rw_xPos"/>
						</canvasTemplate>

						<canvas r_name="'achievementChaosTower'" r_template="'achievement1Template'"
										condition1="globalParameters.scoreTowerOfChaos>4"
										condition2="globalParameters.scoreTowerOfChaos>12"
										condition3="globalParameters.scoreTowerOfChaos>20"
										text1="text.achievChaosTower"/>
						<canvas r_name="'achievementWinEasy'" r_template="'achievement1Template'"
										condition1="globalParameters.achievWinGameEasy"
										text1="text.achievWinGameEasy"/>
						<canvas r_name="'achievConjuration'" r_template="'achievement1Template'"
										condition1="globalParameters.achievConjuration"
										text1="text.achievConjuration"/>
						<canvas r_name="'achievEnchantment'" r_template="'achievement1Template'"
										condition1="globalParameters.achievEnchantment"
										text1="text.achievEnchantment"/>
						<canvas r_name="'achievEvocation'" r_template="'achievement1Template'"
										condition1="globalParameters.achievEvocation"
										text1="text.achievEvocation"/>
						<canvas r_name="'achievTransmutation'" r_template="'achievement1Template'"
										condition1="globalParameters.achievTransmutation"
										text1="text.achievTransmutation"/>

						<canvas r_name="'achievementWin'" r_template="'achievement3Template'"
										condition1="globalParameters.achievWinGame"
										condition2="globalParameters.achievWinGameAlive"
										condition3="globalParameters.achievWinGame7Days"
										text1="text.achievWinGame"
										text2="text.achievWinGameAlive"
										text3="text.achievWinGame7Days"/>
										
						<canvas r_name="'achievementRNG'" r_template="'achievement3Template'"
										condition1="globalParameters.achievKillRNG"
										condition2="globalParameters.achievKillRNGAlive"
										condition3="globalParameters.achievKillRNG7Days"
										text1="text.achievKillRNG"
										text2="text.achievKillRNGAlive"
										text3="text.achievKillRNG7Days"/>
					</canvas>
				</canvas>
			</canvas>
			
			<canvas r_name="'resetAchievments'" r_template="'capsuleButtonTemplate'"
							capsuleText="text.resetAchievments"
							capsuleEffect="all({globalParameters.achievWinGameEasy=0,
																	globalParameters.achievWinGame=0,
																	globalParameters.achievWinGameAlive=0,
																	globalParameters.achievWinGame7Days=0,
																	globalParameters.achievKillRNG=0,
																	globalParameters.achievKillRNGAlive=0,
																	globalParameters.achievKillRNG7Days=0,
																	globalParameters.achievConjuration=0,
																	globalParameters.achievEnchantment=0,
																	globalParameters.achievEvocation=0,
																	globalParameters.achievTransmutation=0,
																	globalParameters.scoreTowerOfChaos=0})"
							capsuleWidth="200*globalParameters.screenScale"
							capsuleHeight="40*globalParameters.screenScale"
							rw_xPos="globalParameters.w_stageWidth-capsuleWidth-10"
							rw_yPos="globalParameters.w_stageHeight-capsuleHeight-10"
							scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'">
					<event r_name="'isDown'">
						<effect r_name="'graphicRefresh'" r_refreshTarget="'achievements'"/>
					</event>
				</button>
			</canvas>
							
			<!-- Return -->
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.return" capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-40*globalParameters.screenScale-10" scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
				</button>
			</canvas>
		</canvas>

		<!-- -->
		<!-- CREDITS -->
		<!-- -->
		<canvas r_name="'credits'" r_template="'mainCanvasTemplate'" r_graphic="'rngsdk.display.CdplSpriteSimple'">
			<canvas r_name="'scroll'" r_template="'scrollTemplate'"
							scrollWidth="globalParameters.w_stageWidth"
							scrollHeight="globalParameters.w_stageHeight-10-40*globalParameters.screenScale">
				<canvas r_name="'maskedZone'" r_template="'verticalSizedMaskedZone'"
								rw_xPos="40"
								rw_yPos="50"
								minimumSize="idealSize"
								idealSize="800*globalParameters.screenScale"
								maximumSize="scrollHeight-100"
								innerWidth="scrollWidth-80"
								snapping="0"
								childMove="0">
					<canvas r_name="'draggedZone'" rw_frameCount="0">
						<event r_name="'onFrame'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
							<effect r_name="'scrolling'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="rw_frameCount>100" r_effect="rw_yPos-=2"/>
							<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'" r_refreshTarget="'maskedZone'" />
						</event>
						<event r_name="'onDrag'" r_template="'mainEventTemplate'" r_eventTarget="'w_isDragged'" r_targetType="'attribute'">
							<effect r_name="'scrolling'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="rw_frameCount=-1"/>
						</event>
						<canvas r_name="'sizer'">
							<textTemplate r_name="'TitleTemplate'" r_template="'mainTextFieldTemplate'" r_text="''" rw_xPos="(globalParameters.w_stageWidth-r_width)/2" textSize="20*globalParameters.screenScale" r_width="w_textWidth+4" r_height="w_textHeight+4"/>
							<textTemplate r_name="'TextTemplate'" r_template="'mainTextFieldTemplate'" r_text="''" rw_xPos="(globalParameters.w_stageWidth-r_width)/2" textSize="14*globalParameters.screenScale" r_width="w_textWidth+4" r_height="w_textHeight+4"/>
							<text r_name="'Space1'" r_template="'TextTemplate'" r_text="'\n\n'"/>
							<text r_name="'ScoringTitle'" r_template="'TitleTemplate'" r_text="text.scoringTitle"/>
							<text r_name="'Scoring'" r_template="'TextTemplate'" r_text="text.scoringValues"/>
							<text r_name="'Space2'" r_template="'TextTemplate'" r_text="'\n\n'"/>
							<text r_name="'CodersTitle'" r_template="'TitleTemplate'" r_text="text.codeAndGameDesign"/>
							<text r_name="'Coders'" r_template="'TextTemplate'" r_text="'Antoine Moreau\n'"/>
							<button r_name="'logoRNG'" r_template="'mainButtonTemplate'" r_graphic="'logoRatzNGodz.png'" rw_xPos="(globalParameters.w_stageWidth-w_initialWidth*r_scaleX)/2" r_scaleX="globalParameters.screenScale/2" r_scaleY="globalParameters.screenScale/2">
								<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
												r_className="'CctlEffectOpenURL'"
												r_link="'http://www.ratzngodz.fr'"/>
							</button>
							<text r_name="'graphicDesignersTitle'" r_template="'TitleTemplate'" r_text="text.graphicsAndMusics"/>
							<text r_name="'graphicDesigners'" r_template="'TextTemplate'" r_text="'Julien Rocca\nJulien Thiennot\n'"/>
							<button r_name="'logoSB'" r_template="'mainButtonTemplate'" r_graphic="'logoStorybird.png'" rw_xPos="(globalParameters.w_stageWidth-w_initialWidth*r_scaleX)/2" r_scaleX="globalParameters.screenScale/2" r_scaleY="globalParameters.screenScale/2">
								<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
												r_className="'CctlEffectOpenURL'"
												r_link="'http://www.findingteddy.com/'"/>
							</button>
							<text r_name="'testersTitle'" r_template="'TitleTemplate'" r_text="text.testers"/>
							<text r_name="'testers'" r_template="'TextTemplate'" r_text="'Clib\nGusty\nFeydreva\nMalfasus\nTolkhan\nGlen\nDodo\nMemed\nYom\n'"/>
							<text r_name="'specialThanksTitle'" r_template="'TitleTemplate'" r_text="text.specialThanks"/>
							<text r_name="'specialThanks'" r_template="'TextTemplate'" r_text="'Alexandre Temple\nMemed\nAtvaark'"/>
						</canvas>
					</canvas>
					<button r_name="'downArrow'" rw_yPos="outerHeight"/>
					<button r_name="'upArrow'" rw_yPos="-w_initialHeight*globalParameters.screenPixelScale"/>
				</canvas>
			</canvas>
			
			<!-- Return -->
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.return" capsuleWidth="160*globalParameters.screenScale" capsuleHeight="40*globalParameters.screenScale" rw_xPos="10" rw_yPos="globalParameters.w_stageHeight-40*globalParameters.screenScale-10" scale="globalParameters.screenScale">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'removeWorld'" r_template="'mainSelfEffectTemplate'" r_type="'RemoveWorld'"/>
					<effect r_name="'clearSave'" r_template="'mainSelfEffectTemplate'" r_type="'ClearSave'"/>
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
				</button>
			</canvas>
		</canvas>

		<!-- -->
		<!-- DEBUG -->
		<!-- -->
		<canvas r_name="'debug'" r_template="'mainCanvasTemplate'" r_debugLibrary="'TU'" r_debugName="'TU_simple1'" debugText="''" r_debugTarget="'debugText'">
			<canvas r_name="'library'" r_template="'capsuleInputWithTextTemplate'"
							capsuleLabel="'Lib'"
							initialInputText="'TU'"
							labelSize="40*globalParameters.screenScale"
							capsuleEffect="r_debugLibrary=inputText"
							rw_xPos="10"
							rw_yPos="5">
				<input r_name="'capsuleInput'">
					<effect r_name="'activation'">
						<effect r_name="'activation2'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectDebugAttributeMap'" r_package="'rngsdk.debug'"/>
						<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
					</effect>
				</input>
			</canvas>
			<canvas r_name="'elementName'" r_template="'capsuleInputWithTextTemplate'"
							capsuleLabel="'Name'"
							initialInputText="'TU_simple1'"
							labelSize="50*globalParameters.screenScale"
							capsuleEffect="r_debugName=inputText"
							rw_xPos="220"
							rw_yPos="5">
				<input r_name="'capsuleInput'">
					<effect r_name="'activation'">
						<effect r_name="'activation2'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_className="'CctlEffectDebugAttributeMap'" r_package="'rngsdk.debug'"/>
						<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
					</effect>
				</input>
			</canvas>			
			<text r_name="'text'" r_template="'mainTextFieldTemplate'" r_text="debugText" rw_xPos="5" rw_yPos="60" r_width="globalParameters.w_stageWidth-10" r_height="globalParameters.w_stageHeight-65" r_wordWrap="1" r_selectable="1" r_mouseEnabled="1" r_textColor="16777215"/>
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" rw_xPos="globalParameters.w_stageWidth-210" rw_yPos="5" capsuleText="'Return'">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
				</button>
			</canvas>
		</canvas>

		<!-- -->
		<!-- CUT SCENE -->
		<!-- -->
		<canvasTemplate r_name="'cutsceneAnimationTemplate'" r_template="'sequencer'"
										r_graphic="'rngsdk.display.CdplSpriteSimple'"
										pictures="{'ToBeReplaced'}"
										texts="{'ToBeReplaced'}"
										currentStep="0"
										rw_frameCount="0"
										textCount="rw_frameCount/2"
										activateFinalEffect="0">
			<canvas r_name="'pictures'" r_template="'mainCanvasTemplate'"
							r_graphic="'rngsdk.display.CdplSpriteSimple'"
							r_width="globalParameters.w_stageWidth"
							r_height="globalParameters.w_stageHeight">
				<picture r_name="'background'" r_template="'mainPictureTemplate'" r_graphic="'intro_back.png'"/>
				<picture r_name="'currentPicture'" r_template="'mainPictureTemplate'" r_graphic="pictures[currentStep]" rw_yPos="164" />
			</canvas>
			<canvas r_name="'cutsceneText'" r_template="'capsuleDarkTextTemplate'"
							capsuleText="gameParameters.mapMessage"
							rw_xPos="100*globalParameters.screenScale"
							rw_yPos="min(globalParameters.w_stageHeight-capsuleHeight-40*globalParameters.screenScale-20, (3/5)*globalParameters.w_stageHeight)"
							capsuleWidth="globalParameters.w_stageWidth-200*globalParameters.screenScale"
							capsuleHeight="min(120*globalParameters.screenScale,globalParameters.w_stageHeight/4)"
							scale="globalParameters.screenScale">
				<text r_name="'capsuleText'" r_text="substring(texts[currentStep],0,textCount)" r_wordWrap="1" textSize="20*scale" r_align="'left'">
					<event r_name="'onFrame'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
						<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
					</event>
				</text>
			</canvas>
			<canvas r_name="'skipButtonTemplate'" r_template="'capsuleSimpleButtonTemplate'"
							capsuleWidth="100*globalParameters.screenScale"
							capsuleHeight="40*globalParameters.screenScale"
							scale="globalParameters.screenScale">
				<text r_name="'capsuleText'" textSize="18*scale"/>
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'refresh'" r_template="'mainGraphicEffectTemplate'" r_type="'Refresh'"/>
				</button>
			</canvas>
			<canvas r_name="'skipButton'" r_template="'skipButtonTemplate'"
							rw_xPos="globalParameters.w_stageWidth-40-2*capsuleWidth"
							rw_yPos="globalParameters.w_stageHeight-10-capsuleHeight"
							capsuleText="text.skip">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'finalEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}"
									r_effect="activateFinalEffect=1"/>
				</button>
			</canvas>
			<canvas r_name="'nextButton'" r_template="'skipButtonTemplate'"
							rw_xPos="globalParameters.w_stageWidth-30-capsuleWidth"
							rw_yPos="globalParameters.w_stageHeight-10-capsuleHeight"
							capsuleText="text.next">
				<button r_name="'capsuleButton'" r_enabled="rw_frameCount>5" r_keys="'any'">
					<effect r_name="'finalEffect'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}"
									r_enabled="(textCount>length(texts[currentStep]))&&((length(pictures)-1)==currentStep)"
									r_effect="activateFinalEffect=1"/>
					<effect r_name="'finishTextLastStep'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}"
									r_enabled="(length(texts[currentStep])>textCount)&&((length(pictures)-1)==currentStep)"
									r_effect="all({rw_frameCount=9999})"/>
					<effect r_name="'nextStep'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}"
									r_enabled="((length(pictures)-1)>currentStep)"
									r_effect="(length(texts[currentStep])>textCount)?all({rw_frameCount=9999}):all({currentStep++,rw_frameCount=0})"/>
				</button>
			</canvas>
			<event r_name="'onFinalEffect'" r_template="'mainEventTemplate'" r_eventTarget="'activateFinalEffect'" r_targetType="'attribute'">
			</event>
		</canvasTemplate>
		<!-- Introduction -->
		<canvas r_name="'introduction'" r_template="'cutsceneAnimationTemplate'"
						pictures="{'intro1.png','intro2.png','intro3.png','intro4.png','intro4.png'}"
						texts="{text.cutSceneIntroduction1,text.cutSceneIntroduction2,text.cutSceneIntroduction3,text.cutSceneIntroduction4,text.cutSceneIntroduction5}">
			<event r_name="'onFinalEffect'">
				<effect r_name="'configureSequence'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="frameStepToExecute={'showLoading','refresh','gotoGame'}"/>
			</event>
		</canvas>
		<!-- Conclusion -->
		<canvasTemplate r_name="'conclusionTemplate'" r_template="'cutsceneAnimationTemplate'">
			<event r_name="'onFinalEffect'">
				<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'credits'"/>
			</event>
		</canvasTemplate>
		<canvas r_name="'conclusionVictory'" r_template="'conclusionTemplate'"
						pictures="{'goodend1.png','goodend2.png','goodend2.png','goodend3.png','goodend3.png'}"
						texts="{text.cutSceneWinPrincess1,text.cutSceneWinPrincess2,text.cutSceneWinPrincess3,text.cutSceneWinPrincess4,text.cutSceneWinPrincess5}">
		</canvas>
		<canvas r_name="'conclusionDarkVictory'" r_template="'conclusionTemplate'"
						pictures="{'secondending1.png','secondending1.png','secondending2.png','secondending3.png','secondending3.png'}"
						texts="{text.cutSceneWinDemon1,text.cutSceneWinDemon2,text.cutSceneWinDemon3,text.cutSceneWinDemon4,text.cutSceneWinDemon5}">
		</canvas>
		<canvas r_name="'conclusionFailed'" r_template="'conclusionTemplate'"
						pictures="{'goodend3.png'}"
						texts="{text.cutSceneFailCampaignText}">
		</canvas>
		<canvas r_name="'resetAndMainMenu'" r_template="'mainCanvasTemplate'" rw_frameCount="0">
			<event r_name="'onLoaded'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<effect r_name="'removeWorld'" r_template="'mainSelfEffectTemplate'" r_enabled="rw_frameCount>0" r_type="'RemoveWorld'"/>
				<effect r_name="'clearSave'" r_template="'mainSelfEffectTemplate'" r_enabled="rw_frameCount>0" r_type="'ClearSave'"/>
				<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_enabled="rw_frameCount>0" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
			</event>
		</canvas>
		<canvas r_name="'freeVersionFinished'" r_template="'scrollTemplate'"
						scrollWidth="globalParameters.w_stageWidth"
						scrollHeight="globalParameters.w_stageHeight"
						rw_frameCount="0">
			<event r_name="'onLoaded'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<effect r_name="'removeWorld'" r_template="'mainSelfEffectTemplate'" r_enabled="rw_frameCount>0" r_type="'RemoveWorld'"/>
				<effect r_name="'clearSave'" r_template="'mainSelfEffectTemplate'" r_enabled="rw_frameCount>0" r_type="'ClearSave'"/>
			</event>
			<text r_name="'scrollText'" r_template="'mainTextFieldTemplate'" r_text="text.freeVersionFinished" r_width="scrollWidth-100" r_height="w_textHeight+4" textSize="15*globalParameters.UIScale" rw_xPos="50" rw_yPos="100" r_wordWrap="1" r_align="'center'"/>
			<canvas r_name="'returnButton'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.return" capsuleWidth="160*scale" capsuleHeight="40*scale" rw_xPos="40" rw_yPos="globalParameters.w_stageHeight-50-capsuleHeight" scale="globalParameters.UIScale">
				<button r_name="'capsuleButton'" r_keys="{'ESCAPE','BACK'}">
					<effect r_name="'screenChange'" r_template="'mainGraphicEffectTemplate'" r_type="'ChangeScreen'" r_newScreen="'mainMenu'"/>
				</button>
			</canvas>
			<canvas r_name="'gotoStore'" r_template="'capsuleSimpleButtonTemplate'" capsuleText="text.buyFullVersion" capsuleWidth="160*scale" capsuleHeight="40*scale" rw_xPos="globalParameters.w_stageWidth-capsuleWidth-40" rw_yPos="globalParameters.w_stageHeight-50-capsuleHeight" scale="globalParameters.UIScale">
				<button r_name="'capsuleButton'">
					<effect r_name="'openURL'" r_template="{'mainSelfEffectTemplate','controllerEffect'}"
									r_className="'CctlEffectOpenURL'"
									r_link="globalParameters.static.android1QuestLink"/>
				</button>
			</canvas>
		</canvas>
		
		<!-- -->
		<!-- Notification -->
		<!-- -->
		<canvas r_name="'mainNotification'" r_template="'mainCanvasTemplate'"
						r_graphic="'rngsdk.display.CdplSpriteSimple'"
						pictureSize="50*globalParameters.screenPixelScale"
						rw_xPos="globalParameters.w_stageWidth/2"
						rw_yPos="(globalParameters.r_nexus10Mode)?0:((min(min(rw_frameCount, 60-rw_frameCount),10)-10)*pictureSize/10)"
						r_visible="length(currentNotification)>0"
						currentNotification="{}"
						rw_frameCount="-1"
						w_loaded="0"
						notifXStart="0"
						notifWidth="pictureSize">
			<event r_name="'refresh'" r_template="'mainEventTemplate'" r_eventTarget="'gameParameters.notifications'" r_targetType="'attribute'">
				<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
				<effect r_name="'showLoading'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(length(gameParameters.notifications)>0)&&(length(currentNotification)==0)" r_effect="all({currentNotification=(splice(gameParameters.notifications,0,1))[0],rw_frameCount=0})"/>
			</event>
			<event r_name="'onFrameCount'" r_template="'mainEventTemplate'" r_eventTarget="'rw_frameCount'" r_targetType="'attribute'">
				<effect r_name="'graphicRefresh'" r_template="'mainGraphicEffectTemplate'" r_type="'LocalRefresh'"/>
				<effect r_name="'resetLoading'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="rw_frameCount==60" r_effect="all({rw_frameCount=-1,currentNotification={}})"/>
				<effect r_name="'showLoading'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(length(gameParameters.notifications)>0)&&(length(currentNotification)==0)" r_effect="all({currentNotification=(splice(gameParameters.notifications,0,1))[0],rw_frameCount=0})"/>
			</event>
			<event r_name="'loaded'" r_template="'mainEventTemplate'" r_eventTarget="'w_loaded'" r_targetType="'attribute'">
				<effect r_name="'resetNotifications'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="gameParameters.notifications={}"/>
			</event>
			<button r_name="'clickHandler'" r_template="'mainButtonTemplate'" r_graphic="'vwBlackLayer'" r_alpha="0.7" r_height="pictureSize" r_width="notifWidth" rw_xPos="notifXStart">
				<effect r_name="'openCS'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="all({externalCSOpening=currentNotification[2],externalCSSelection=currentNotification[3]})"/>
			</button>
			<text r_name="'textNotif'" r_template="'mainTextFieldTemplate'" r_text="currentNotification[0]" rw_xPos="-(w_textWidth+4)" rw_yPos="(pictureSize-r_height)/2" r_width="w_textWidth+4" r_height="w_textHeight+4" textSize="10*globalParameters.screenScale" r_align="'right'" r_textColor="16777215">
				<modifier r_name="'notifXStart'" r_template="'mainModifierTemplate'" r_modifierTarget="'notifXStart'" r_modifiedValue="rw_xPos"/>
				<modifier r_name="'notifWidth'" r_template="'mainModifierTemplate'" r_modifierTarget="'notifWidth'" r_modifiedValue="$0+r_width"/>
			</text>
			<picture r_name="'pictureNotif'" r_template="'mainPictureTemplate'" r_graphic="currentNotification[1]" r_height="pictureSize" r_width="pictureSize"/>
		</canvas>
	</canvases>
</data>