| 
									
										
										
										
											2024-12-11 15:08:57 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 文件名:FontAsset.nut | 
					
						
							|  |  |  | 路径:User/Asset/FontAsset.nut | 
					
						
							|  |  |  | 创建日期:2024-12-10	11:37 | 
					
						
							|  |  |  | 文件用途: | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class _FontAssetManager_ { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     //初始化字体 | 
					
						
							|  |  |  |     function InitFont() { | 
					
						
							|  |  |  |         //普通宋体小字 | 
					
						
							| 
									
										
										
										
											2024-12-27 22:44:45 +08:00
										 |  |  |         // Font.PreLoad("新宋体"); | 
					
						
							| 
									
										
										
										
											2025-01-02 19:19:36 +08:00
										 |  |  |         Font("宋体", 11.5).Register(0); | 
					
						
							| 
									
										
										
										
											2024-12-11 15:08:57 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     constructor() { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //初始化字体 | 
					
						
							|  |  |  |         InitFont(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         getroottable().FontAssetManager <- this; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     //生成普通宋体小字 | 
					
						
							| 
									
										
										
										
											2024-12-14 21:31:44 +08:00
										 |  |  |     function GenerateNormal(text, stroke, style = {}) { | 
					
						
							| 
									
										
										
										
											2024-12-11 15:08:57 +08:00
										 |  |  |         //登录按钮文本 | 
					
						
							| 
									
										
										
										
											2024-12-14 21:31:44 +08:00
										 |  |  |         local TextActor = TextActor(0, style); | 
					
						
							| 
									
										
										
										
											2024-12-11 15:08:57 +08:00
										 |  |  |         TextActor.SetText(text); | 
					
						
							|  |  |  |         if (stroke) | 
					
						
							| 
									
										
										
										
											2024-12-27 15:26:20 +08:00
										 |  |  |             TextActor.SetOutline(); | 
					
						
							| 
									
										
										
										
											2024-12-11 15:08:57 +08:00
										 |  |  |         return TextActor; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |