no message
This commit is contained in:
		
							parent
							
								
									e464fb899d
								
							
						
					
					
						commit
						0d1b146235
					
				|  | @ -185,7 +185,120 @@ class Yosin_EmeStretch extends Yosin_CommonUi { | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // //九宫格拉伸 | ||||||
|  | // class Yosin_NineBoxStretch extends Yosin_CommonUi { | ||||||
| 
 | 
 | ||||||
|  | //     constructor(X, Y, W, H, Path, Idx) { | ||||||
|  | //         base.constructor(X, Y, W, H); | ||||||
|  | //         DrawBackground(W, H, Path, Idx); | ||||||
|  | //     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | //     // 绘制 | ||||||
|  | //     function DrawBackground(width, height, path, imgId) { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | //         // 创建画布 | ||||||
|  | //         local Canvas = CL_CanvasObject(); | ||||||
|  | //         // 重设大小并清空 | ||||||
|  | //         Canvas.ResizeAndClear(width, height); | ||||||
|  | //         // 开始绘制 | ||||||
|  | //         Canvas.BeginDraw(); | ||||||
|  | 
 | ||||||
|  | //         // 左上角 | ||||||
|  | //         local backgroundTopLeft = CL_SpriteObject(path, imgId); | ||||||
|  | //         // 上边 | ||||||
|  | //         local backgroundTop = CL_SpriteObject(path, imgId + 1); | ||||||
|  | //         // 右上角 | ||||||
|  | //         local backgroundTopRight = CL_SpriteObject(path, imgId + 2); | ||||||
|  | //         // 左边 | ||||||
|  | //         local backgroundLeft = CL_SpriteObject(path, imgId + 3); | ||||||
|  | //         // 中间 | ||||||
|  | //         local backgroundCenter = CL_SpriteObject(path, imgId + 4); | ||||||
|  | //         // 右边 | ||||||
|  | //         local backgroundRight = CL_SpriteObject(path, imgId + 5); | ||||||
|  | //         // 左下角 | ||||||
|  | //         local backgroundBottomLeft = CL_SpriteObject(path, imgId + 6); | ||||||
|  | //         // 下边 | ||||||
|  | //         local backgroundBottom = CL_SpriteObject(path, imgId + 7); | ||||||
|  | //         // 右下角 | ||||||
|  | //         local backgroundBottomRight = CL_SpriteObject(path, imgId + 8); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | //         // 左上角 | ||||||
|  | //         // backgroundTopLeft.SetPosition(0, 0); | ||||||
|  | //         // Addchild(backgroundTopLeft); | ||||||
|  | //         Canvas.DrawActor(backgroundTopLeft, 0, 0); | ||||||
|  | 
 | ||||||
|  | //         local TopLeftSize = backgroundTopLeft.GetSize(); | ||||||
|  | //         local TopLeftBottom = TopLeftSize.h; | ||||||
|  | //         local TopLeftRight = TopLeftSize.w; | ||||||
|  | 
 | ||||||
|  | //         // 中间图片大小 | ||||||
|  | //         local centerImgSize = backgroundCenter.GetSize(); | ||||||
|  | //         local centerImgWidth = centerImgSize.w; | ||||||
|  | //         local centerImgHeight = centerImgSize.h; | ||||||
|  | 
 | ||||||
|  | //         local centerWidth = width - backgroundTopLeft.GetSize().w - backgroundTopRight.GetSize().w; | ||||||
|  | //         local centerHeight = height - backgroundTopLeft.GetSize().h - backgroundBottomLeft.GetSize().h; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | //         local scaleW = (centerWidth - 1).tofloat() / centerImgWidth.tofloat(); | ||||||
|  | //         local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat(); | ||||||
|  | 
 | ||||||
|  | //         // 上边 | ||||||
|  | //         // backgroundTop.SetPosition(backgroundTopLeft.right() + 1, 0); | ||||||
|  | //         backgroundTop.SetScale(scaleW, 1); | ||||||
|  | //         // Addchild(backgroundTop); | ||||||
|  | //         Canvas.DrawActor(backgroundTop, TopLeftRight + 1, 0); | ||||||
|  | 
 | ||||||
|  | //         // 右上角 | ||||||
|  | //         // backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w, 0); | ||||||
|  | //         // Addchild(backgroundTopRight); | ||||||
|  | //         Canvas.DrawActor(backgroundTopRight, width - backgroundTopRight.GetSize().w, 0); | ||||||
|  | 
 | ||||||
|  | //         // 左边 | ||||||
|  | //         // backgroundLeft.SetPosition(0, backgroundTopLeft.bottom() + 1); | ||||||
|  | //         backgroundLeft.SetScale(1, scaleH); | ||||||
|  | //         // Addchild(backgroundLeft); | ||||||
|  | //         Canvas.DrawActor(backgroundLeft, 0, TopLeftBottom + 1); | ||||||
|  | 
 | ||||||
|  | //         // 中间 | ||||||
|  | //         // backgroundCenter.SetPosition(backgroundLeft.right() + 1, backgroundLeft.Y); | ||||||
|  | //         backgroundCenter.SetScale(scaleW, scaleH); | ||||||
|  | //         // Addchild(backgroundCenter); | ||||||
|  | //         Canvas.DrawActor(backgroundCenter, TopLeftRight + 1, backgroundLeft.Y); | ||||||
|  | 
 | ||||||
|  | //         // 右边 | ||||||
|  | //         // backgroundRight.SetPosition(width - backgroundRight.GetSize().w, backgroundCenter.Y); | ||||||
|  | //         backgroundRight.SetScale(1, scaleH); | ||||||
|  | //         // Addchild(backgroundRight); | ||||||
|  | //         Canvas.DrawActor(backgroundRight, width - backgroundRight.GetSize().w, backgroundCenter.Y); | ||||||
|  | 
 | ||||||
|  | //         // 左下角 | ||||||
|  | //         // backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h); | ||||||
|  | //         // Addchild(backgroundBottomLeft); | ||||||
|  | //         Canvas.DrawActor(backgroundBottomLeft, 0, height - backgroundBottomLeft.GetSize().h); | ||||||
|  | 
 | ||||||
|  | //         // 下边 | ||||||
|  | //         // backgroundBottom.SetPosition(backgroundBottomLeft.right() + 1, backgroundBottomLeft.Y); | ||||||
|  | //         backgroundBottom.SetScale(scaleW, 1); | ||||||
|  | //         // Addchild(backgroundBottom); | ||||||
|  | //         Canvas.DrawActor(backgroundBottom, TopLeftRight + 1, backgroundBottomLeft.Y); | ||||||
|  | 
 | ||||||
|  | //         // 右下角 | ||||||
|  | //         // backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y); | ||||||
|  | //         // Addchild(backgroundBottomRight); | ||||||
|  | //         Canvas.DrawActor(backgroundBottomRight,width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y ); | ||||||
|  | 
 | ||||||
|  | //         // 结束绘制 | ||||||
|  | //         Canvas.EndDraw(); | ||||||
|  | //         // 添加画布 | ||||||
|  | //         Addchild(Canvas); | ||||||
|  | 
 | ||||||
|  | //     } | ||||||
|  | 
 | ||||||
|  | // } | ||||||
| 
 | 
 | ||||||
| //九宫格拉伸 | //九宫格拉伸 | ||||||
| class Yosin_NineBoxStretch extends Yosin_CommonUi { | class Yosin_NineBoxStretch extends Yosin_CommonUi { | ||||||
|  | @ -200,7 +313,15 @@ class Yosin_NineBoxStretch extends Yosin_CommonUi { | ||||||
|     function DrawBackground(width, height, path, imgId) { |     function DrawBackground(width, height, path, imgId) { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |         // 创建画布 | ||||||
|  |         local Canvas = CL_CanvasObject(); | ||||||
|  |         // 重设大小并清空 | ||||||
|  |         Canvas.ResizeAndClear(width, height); | ||||||
|  |         // 开始绘制 | ||||||
|  |         Canvas.BeginDraw(); | ||||||
|  | 
 | ||||||
|         // 左上角 |         // 左上角 | ||||||
|  |         // local backgroundTopLeft = CL_SpriteObject(path, imgId); | ||||||
|         local backgroundTopLeft = CL_SpriteObject(path, imgId); |         local backgroundTopLeft = CL_SpriteObject(path, imgId); | ||||||
|         // 上边 |         // 上边 | ||||||
|         local backgroundTop = CL_SpriteObject(path, imgId + 1); |         local backgroundTop = CL_SpriteObject(path, imgId + 1); | ||||||
|  | @ -221,8 +342,13 @@ class Yosin_NineBoxStretch extends Yosin_CommonUi { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         // 左上角 |         // 左上角 | ||||||
|         backgroundTopLeft.SetPosition(0, 0); |         // backgroundTopLeft.SetPosition(0, 0); | ||||||
|         Addchild(backgroundTopLeft); |         // Addchild(backgroundTopLeft); | ||||||
|  |         Canvas.DrawActor(backgroundTopLeft, 0, 0); | ||||||
|  | 
 | ||||||
|  |         local TopLeftSize = backgroundTopLeft.GetSize(); | ||||||
|  |         local TopLeftBottom = TopLeftSize.h; | ||||||
|  |         local TopLeftRight = TopLeftSize.w; | ||||||
| 
 | 
 | ||||||
|         // 中间图片大小 |         // 中间图片大小 | ||||||
|         local centerImgSize = backgroundCenter.GetSize(); |         local centerImgSize = backgroundCenter.GetSize(); | ||||||
|  | @ -237,41 +363,40 @@ class Yosin_NineBoxStretch extends Yosin_CommonUi { | ||||||
|         local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat(); |         local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat(); | ||||||
| 
 | 
 | ||||||
|         // 上边 |         // 上边 | ||||||
|         backgroundTop.SetPosition(backgroundTopLeft.right() + 1, 0); |         // backgroundTop.SetScale(scaleW, 1); | ||||||
|         backgroundTop.SetScale(scaleW, 1); |         // Canvas.DrawActor(backgroundTop, TopLeftRight + 1, 0); | ||||||
|         Addchild(backgroundTop); |         // Canvas.DrawActor(backgroundTop, 20, 30); | ||||||
| 
 | 
 | ||||||
|         // 右上角 |         // // 右上角 | ||||||
|         backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w, 0); |         // Canvas.DrawActor(backgroundTopRight, width - backgroundTopRight.GetSize().w, 0); | ||||||
|         Addchild(backgroundTopRight); |  | ||||||
| 
 | 
 | ||||||
|         // 左边 |         // // 左边 | ||||||
|         backgroundLeft.SetPosition(0, backgroundTopLeft.bottom() + 1); |         // backgroundLeft.SetScale(1, scaleH); | ||||||
|         backgroundLeft.SetScale(1, scaleH); |         // Canvas.DrawActor(backgroundLeft, 0, TopLeftBottom + 1); | ||||||
|         Addchild(backgroundLeft); |  | ||||||
| 
 | 
 | ||||||
|         // 中间 |         // // 中间 | ||||||
|         backgroundCenter.SetPosition(backgroundLeft.right() + 1, backgroundLeft.Y); |         // backgroundCenter.SetScale(scaleW, scaleH); | ||||||
|         backgroundCenter.SetScale(scaleW, scaleH); |         // // Addchild(backgroundCenter); | ||||||
|         Addchild(backgroundCenter); |         // Canvas.DrawActor(backgroundCenter, TopLeftRight + 1, backgroundLeft.Y); | ||||||
| 
 | 
 | ||||||
|         // 右边 |         // // 右边 | ||||||
|         backgroundRight.SetPosition(width - backgroundRight.GetSize().w, backgroundCenter.Y); |         // backgroundRight.SetScale(1, scaleH); | ||||||
|         backgroundRight.SetScale(1, scaleH); |         // Canvas.DrawActor(backgroundRight, width - backgroundRight.GetSize().w, backgroundCenter.Y); | ||||||
|         Addchild(backgroundRight); |  | ||||||
| 
 | 
 | ||||||
|         // 左下角 |         // // 左下角 | ||||||
|         backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h); |         // Canvas.DrawActor(backgroundBottomLeft, 0, height - backgroundBottomLeft.GetSize().h); | ||||||
|         Addchild(backgroundBottomLeft); |  | ||||||
| 
 | 
 | ||||||
|         // 下边 |         // // 下边 | ||||||
|         backgroundBottom.SetPosition(backgroundBottomLeft.right() + 1, backgroundBottomLeft.Y); |         // backgroundBottom.SetScale(scaleW, 1); | ||||||
|         backgroundBottom.SetScale(scaleW, 1); |         // Canvas.DrawActor(backgroundBottom, TopLeftRight + 1, backgroundBottomLeft.Y); | ||||||
|         Addchild(backgroundBottom); |  | ||||||
| 
 | 
 | ||||||
|         // 右下角 |         // // 右下角 | ||||||
|         backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y); |         // Canvas.DrawActor(backgroundBottomRight,width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y ); | ||||||
|         Addchild(backgroundBottomRight); | 
 | ||||||
|  |         // 结束绘制 | ||||||
|  |         Canvas.EndDraw(); | ||||||
|  |         // 添加画布 | ||||||
|  |         Addchild(Canvas); | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,12 +14,12 @@ class _Inventory extends Yosin_Window { | ||||||
|         local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)"); |         local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)"); | ||||||
|         Addchild(title); |         Addchild(title); | ||||||
| 
 | 
 | ||||||
|         // local dd = Yosin_CanvasDraw.NineBoxStretch(100, 200, "sprite/interface/lenheartwindowcommon.img", 97); |         local dd = Yosin_NineBoxStretch(100, 200, 100,100 "sprite/interface/lenheartwindowcommon.img", 97); | ||||||
|         // dd.SetPosition(100, 50); |         dd.SetPosition(100, 50); | ||||||
|         // Addchild(dd); |         Addchild(dd); | ||||||
| 
 | 
 | ||||||
|         //注册控件 |         //注册控件 | ||||||
|         RegisterWidget(); |         // RegisterWidget(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function RegisterWidget() { |     function RegisterWidget() { | ||||||
|  |  | ||||||
|  | @ -62,8 +62,41 @@ class Inventory_CharactersEquipment extends Yosin_CommonUi { | ||||||
|         Canvas.EndDraw(); |         Canvas.EndDraw(); | ||||||
|         // 添加画布 |         // 添加画布 | ||||||
|         Addchild(Canvas); |         Addchild(Canvas); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         AddButton(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     // 添加按钮 | ||||||
|  |     function AddButton() { | ||||||
|  |         // 称号 | ||||||
|  |         local designation = Yosin_BaseButton(2, Height - 30, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 50); | ||||||
|  |         //点击事件回调 | ||||||
|  |         // permutationBtn.OnClick = function(Button) { | ||||||
|  |         // }.bindenv(this); | ||||||
|  |         AddUIChild(designation); | ||||||
|  | 
 | ||||||
|  |         // 增益强化 | ||||||
|  |         local intensify = Yosin_BaseButton(designation.right() +2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); | ||||||
|  |         AddUIChild(intensify); | ||||||
|  |         // 皮肤仓库 | ||||||
|  |         local skin = Yosin_BaseButton(intensify.right() + 2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 134); | ||||||
|  |         AddUIChild(skin); | ||||||
|  | 
 | ||||||
|  |         // 穿戴中的装备 | ||||||
|  |         local wear = Yosin_BaseButton(Width - 29, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 172); | ||||||
|  |         AddUIChild(wear); | ||||||
|  |         // 装备特性 | ||||||
|  |         local peculiarity = Yosin_BaseButton(wear.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 203); | ||||||
|  |         AddUIChild(peculiarity); | ||||||
|  |         // 未央环境装备 | ||||||
|  |         // local permutationBtn = Yosin_BaseButton(peculiarity.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); | ||||||
|  |         // AddUIChild(permutationBtn); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     // 背景 |     // 背景 | ||||||
|     function DrawBackground() { |     function DrawBackground() { | ||||||
| 
 | 
 | ||||||
|  | @ -252,14 +285,14 @@ class MoneyItem extends Yosin_CommonUi { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| if (!getroottable().rawin("chongzaiflag")) { | // if (!getroottable().rawin("chongzaiflag")) { | ||||||
|     getroottable()["chongzaiflag"] <- true; | //     getroottable()["chongzaiflag"] <- true; | ||||||
| } else { | // } else { | ||||||
|     //遍历窗口队列 如果可见则调用Show | //     //遍历窗口队列 如果可见则调用Show | ||||||
|     for (local i = 0; i< _SYS_WINDOW_LIST_.len(); i++) { | //     for (local i = 0; i< _SYS_WINDOW_LIST_.len(); i++) { | ||||||
|         local Window = _SYS_WINDOW_LIST_[i]; | //         local Window = _SYS_WINDOW_LIST_[i]; | ||||||
|         Window.Visible = false; | //         Window.Visible = false; | ||||||
|         Window.RemoveSelf(); | //         Window.RemoveSelf(); | ||||||
|     } | //     } | ||||||
|     TestStage(); | //     TestStage(); | ||||||
| } | // } | ||||||
		Loading…
	
		Reference in New Issue