소스 검색

commit in 4.1

小太阳 6 년 전
부모
커밋
4ea9c8ed73
1개의 변경된 파일37개의 추가작업 그리고 5개의 파일을 삭제
  1. 37 5
      code/ui.xml

+ 37 - 5
code/ui.xml

@@ -3,7 +3,7 @@
 	<!--首屏弹出-->
 	<layer name="home" type="container" bgcolor="0x000000" keep="true" width="100%"  height="100%" align="center" zorder="900" bgalpha="1"  bgcapture="true" visible="true" onclick2="if(progress.progress GT 0.9 , set(visible,false))">
 		<layer name="homebg" type="image" url.normal="https://bigscene.4dage.com/panorama/img/pc/homebg.jpg" url.mobile="https://bigscene.4dage.com/panorama/img/mobile/homebg.png" align="top"  
-			keep="true" x="0%" y.mobile="0%" zorder="1"   width.mobile="100%"  height.mobile="prop" visible="true"  onclick2="set(layer[home].visible,false)" onloaded="resize();js(hidload)"/>
+			keep="true" x="0%" y.mobile="0%" zorder="1"     width.mobile="100%"  height.mobile="prop" visible="true"  onclick2="set(layer[home].visible,false)" onloaded="resize();js(hidload);"/>
 		
 		<layer name="hometitle" type="image" url.normal="https://bigscene.4dage.com/panorama/img/pc/title.png" url.mobile="https://bigscene.4dage.com/panorama/img/mobile/title.png" align="top"  
 			keep="true" x="3%" y.mobile="40%" zorder="10"  width.normal="prop" width.mobile="80%" height.normal="46%" height.mobile="prop" visible="true" y="3%"   onloaded=""  onclick2="set(layer[home].visible,false)" />
@@ -18,13 +18,45 @@
 	</layer>
 
 	<events name="ui" keep="true" onresize="resize" />
+
+	<action name="picture_resize">
+ 
+	<!-- 使用屏幕宽度或高度的百分之九十 -->
+	
+	div(aspect, layer[%1].imagewidth, layer[%1].imageheight);
+	
+	mul(new_width, stagewidth, 1);
+	
+	div(new_height, new_width, aspect);
+	
+	mul(max_height, stageheight, 2);
+	
+	if(new_height GT max_height,
+	
+	copy(new_height, max_height);
+	
+	mul(new_width, new_height, aspect);
+	
+	);
+	
+	roundval(new_width);
+	
+	roundval(new_height);
+	
+	copy(layer[%1].width, new_width);
+	
+	copy(layer[%1].height, new_height);
+	
+	</action>
+
+
 	<action name="resize" autorun="onstart">
 		if(device.mobile,
 			div(bl,stagewidth,stageheight);
 			set(layer[scene_info_text].css,color:#fff; font-family:Arial; font-weight:500; font-size:50px; line-height:66px; text-indent:50px;);
 			if(device.iphone,
-				set(layer[homebg].height,prop);
-				set(layer[homebg].width,100%);
+				set(layer[homebg].height,100%);
+				set(layer[homebg].width,prop);
 				,
 				set(layer[homebg].height,100%);
 				set(layer[homebg].width,100%);
@@ -90,7 +122,7 @@
 
 
 
-	<layer name="scene_info_bg" type="container" handcursor="true" bgcolor="0x000000" bgalpha="0.3" keep="true" x="0%" y.mobile="5%" y.normal="5%" zorder="100"  width.normal="24%" width.mobile="60%" height.normal="5%"  height.mobile="6%" visible="true"  onloaded=""  >
+	<layer name="scene_info_bg" type="container" handcursor="true" bgcolor="0x000000" bgalpha="0.3" keep="true" x="0%" y.mobile="5%" y.normal="5%" zorder="100"  width.normal="24%" width.mobile="60%" height.normal="48px"  height.mobile="70px" visible="true"  onloaded=""  >
 		<layer name="scene_info_text" keep="true"
 		       url="https://bigscene.4dage.com/panorama/plugins/textfield.swf"
 		       align="centercenter"
@@ -228,7 +260,7 @@
 		<layer name="btn2" style="btn_base|show_tip" crop="136|136|96|96" x="49%" y="37%" text="背景音乐" etext="Music"
 		onclick="if(crop == '136|136|96|96'
 			,set(crop,20|136|96|96);pausesound(bgm);pausesound(sp);
-			,set(crop,20|136|96|96);resumesound(bgm);autosp(true);)" />
+			,set(crop,136|136|96|96);resumesound(bgm);autosp(true);)" />
 		
 
 		<layer name="btn4" style="btn_base|show_tip" crop="20|368|96|96" x="49%"  y="87%" text="自动旋转" etext="Autorotation"