UI临时提交
This commit is contained in:
		
							parent
							
								
									c814502a74
								
							
						
					
					
						commit
						1ecde645ce
					
				|  | @ -16,7 +16,7 @@ function TestStage() { | ||||||
| 
 | 
 | ||||||
|     local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0); |     local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0); | ||||||
|     local T = { |     local T = { | ||||||
|         Background = 1 |         Background = 0 | ||||||
|     } |     } | ||||||
|     Window.Init(T); |     Window.Init(T); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,33 @@ | ||||||
|  | /* | ||||||
|  | 文件名:Drag_Button.nut | ||||||
|  | 路径:User/UI/Widget/Drag_Button.nut | ||||||
|  | 创建日期:2024-12-14	09:40 | ||||||
|  | 文件用途:拖动按钮 | ||||||
|  | */ | ||||||
|  | class Yosin_DragButton extends Yosin_CommonUi { | ||||||
|  | 
 | ||||||
|  |     //按钮状态 | ||||||
|  |     State = 0; | ||||||
|  |     Path = null; | ||||||
|  |     Idx = null; | ||||||
|  | 
 | ||||||
|  |     Sprite = null; | ||||||
|  |     SpriteState = -1; | ||||||
|  |     FrameList = null; | ||||||
|  | 
 | ||||||
|  |     constructor(X, Y, W, H, Path, Idx) { | ||||||
|  |         this.Path = Path; | ||||||
|  |         this.Idx = Idx; | ||||||
|  |         base.constructor(X, Y, W, H); | ||||||
|  | 
 | ||||||
|  |         FrameList = []; | ||||||
|  |         Sprite = CL_SpriteObject(); | ||||||
|  |         // Sprite.ShowBorder(true); | ||||||
|  |         Addchild(Sprite); | ||||||
|  | 
 | ||||||
|  |         for (local i = 0; i< 4; i++) { | ||||||
|  |             local Sf = CL_SpriteFrameObject(this.Path, this.Idx + i); | ||||||
|  |             FrameList.push(Sf); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,55 @@ | ||||||
|  | /* | ||||||
|  | 文件名:Scroll_Bar.nut | ||||||
|  | 路径:User/UI/Widget/Scroll_Bar.nut | ||||||
|  | 创建日期:2024-12-13	23:17 | ||||||
|  | 文件用途: | ||||||
|  | */ | ||||||
|  | //基础按钮 | ||||||
|  | class Yosin_ScrollBar extends Yosin_CommonUi { | ||||||
|  |     //控制器 | ||||||
|  |     Controller = null; | ||||||
|  | 
 | ||||||
|  |     //是否焦点 | ||||||
|  |     IsFocus = false; | ||||||
|  | 
 | ||||||
|  |     //上按钮 | ||||||
|  |     UpButton = null; | ||||||
|  |     //下按钮 | ||||||
|  |     DownButton = null; | ||||||
|  | 
 | ||||||
|  |     //Path | ||||||
|  |     Path = "sprite/interface/lenheartwindowcommon.img"; | ||||||
|  | 
 | ||||||
|  |     constructor(X, Y, H, gSize) { | ||||||
|  |         base.constructor(X, Y, 9, H > 26 ? H : 26); | ||||||
|  | 
 | ||||||
|  |         Controller = { | ||||||
|  |             CurPos = 0, | ||||||
|  |             Size = gSize | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         //上按钮 | ||||||
|  |         UpButton = Yosin_BaseButton(0, 0, 9, 13, Path, 16); | ||||||
|  |         //点击事件回调 | ||||||
|  |         UpButton.OnClick = function(Button) { | ||||||
|  | 
 | ||||||
|  |         }.bindenv(this); | ||||||
|  |         AddUIChild(UpButton); | ||||||
|  | 
 | ||||||
|  |         //滚动条 | ||||||
|  | 
 | ||||||
|  |         //下按钮 | ||||||
|  |         DownButton = Yosin_BaseButton(0, Height - 13, 9, 13, Path, 22); | ||||||
|  |         //点击事件回调 | ||||||
|  |         DownButton.OnClick = function(Button) { | ||||||
|  | 
 | ||||||
|  |         }.bindenv(this); | ||||||
|  |         AddUIChild(DownButton); | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function Proc(Dt) { | ||||||
|  |         base.Proc(Dt); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | @ -82,11 +82,14 @@ class _Select_Character_SettingBackground_Window extends Yosin_Window { | ||||||
|     //选择背景按钮集合 |     //选择背景按钮集合 | ||||||
|     SettingBackgroundButtonList = null; |     SettingBackgroundButtonList = null; | ||||||
| 
 | 
 | ||||||
|  |     Background = null; | ||||||
|  | 
 | ||||||
|     constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { |     constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { | ||||||
|         base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); |         base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); | ||||||
|         SettingBackgroundButtonList = []; |         SettingBackgroundButtonList = []; | ||||||
| 
 | 
 | ||||||
|         SetClipRect(-gWidth, 0, gWidth, gHeight + 20); |         // SetClipRect(-gWidth, 0, gWidth, gHeight + 20); | ||||||
|  |         // SetClipRect(0, 0, 1066, 600); | ||||||
|         // ShowBorder(true); |         // ShowBorder(true); | ||||||
|         // SetLayerOpacity(1); |         // SetLayerOpacity(1); | ||||||
|     } |     } | ||||||
|  | @ -98,7 +101,7 @@ class _Select_Character_SettingBackground_Window extends Yosin_Window { | ||||||
| 
 | 
 | ||||||
|     function RegisterDraw() { |     function RegisterDraw() { | ||||||
|         //背景 |         //背景 | ||||||
|         local Background = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/setup/setup.img", 17); |         Background = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/setup/setup.img", 17); | ||||||
|         Addchild(Background); |         Addchild(Background); | ||||||
| 
 | 
 | ||||||
|         for (local i = 0; i< 24; i++) { |         for (local i = 0; i< 24; i++) { | ||||||
|  | @ -199,6 +202,14 @@ class _Select_Character_Window extends Yosin_Window { | ||||||
|             } |             } | ||||||
|         }) |         }) | ||||||
|         SettingButton.Addchild(LoginTextActor); |         SettingButton.Addchild(LoginTextActor); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         // local TestButton = Yosin_ScrollBar(300, 200, 50, 100); | ||||||
|  |         // AddUIChild(TestButton); | ||||||
|  |         local TestButton = Yosin_SplicingButton(200, 200, 77, 68 "sprite/interface/lenheartwindowcommon.img", 184, false); | ||||||
|  |         // local TestButton = Yosin_EmeStretch(200, 200, 77, 68 "sprite/interface/lenheartwindowcommon.img", 184, false); | ||||||
|  |         TestButton.SetScale(5.0, 5.0); | ||||||
|  |         AddUIChild(TestButton); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //切换背景 |     //切换背景 | ||||||
|  | @ -209,6 +220,16 @@ class _Select_Character_Window extends Yosin_Window { | ||||||
|         } |         } | ||||||
|         BackGround = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx); |         BackGround = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx); | ||||||
|         BackGround.SetZOrder(-10); |         BackGround.SetZOrder(-10); | ||||||
|  | 
 | ||||||
|  |         /* | ||||||
|  | 
 | ||||||
|  |                 BackGround = Layer(); | ||||||
|  |         BackGround.Addchild(CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx)); | ||||||
|  |         BackGround.SetZOrder(-10); | ||||||
|  |         BackGround.SetPosition(100, 100); | ||||||
|  |         BackGround.SetClipRect(0, 0, 200, 200); | ||||||
|  | 
 | ||||||
|  |         */ | ||||||
|         Addchild(BackGround); |         Addchild(BackGround); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue