| 
									
										
										
										
											2017-11-03 22:14:07 +08:00
										 |  |  |  | #include <easy2d.h>
 | 
					
						
							| 
									
										
										
										
											2017-10-14 01:07:34 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | int main() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	EApp app; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-07 22:20:46 +08:00
										 |  |  |  | 	if (app.init(L"Easy2D Demo", 640, 480)) | 
					
						
							| 
									
										
										
										
											2017-10-14 01:07:34 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2017-11-04 15:38:41 +08:00
										 |  |  |  | 		app.showConsole(); | 
					
						
							| 
									
										
										
										
											2017-10-14 01:07:34 +08:00
										 |  |  |  | 		auto scene = new EScene(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-07 22:20:46 +08:00
										 |  |  |  | 		// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ı<EFBFBD>
 | 
					
						
							|  |  |  |  | 		auto btnNormal = new EText(L"<EFBFBD><EFBFBD>"); | 
					
						
							|  |  |  |  | 		auto btnSelected = new EText(L"<EFBFBD><EFBFBD>"); | 
					
						
							|  |  |  |  | 		btnSelected->movePosY(2); | 
					
						
							|  |  |  |  | 		auto btnNormal2 = new EText(L"<EFBFBD><EFBFBD>"); | 
					
						
							|  |  |  |  | 		auto btnSelected2 = new EText(L"<EFBFBD><EFBFBD>"); | 
					
						
							|  |  |  |  | 		btnSelected2->movePosY(2); | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ť
 | 
					
						
							|  |  |  |  | 		auto button = new EButtonToggle(btnNormal, btnNormal2, btnSelected, btnSelected2); | 
					
						
							|  |  |  |  | 		button->setCallback([=]() { | 
					
						
							|  |  |  |  | 			//button->setEnable(false);
 | 
					
						
							|  |  |  |  | 		}); | 
					
						
							|  |  |  |  | 		button->toggle(); | 
					
						
							|  |  |  |  | 		button->setPos(EApp::getWidth() / 2, EApp::getHeight() / 2); | 
					
						
							|  |  |  |  | 		scene->add(button); | 
					
						
							| 
									
										
										
										
											2017-11-04 11:11:16 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-07 22:20:46 +08:00
										 |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
 | 
					
						
							|  |  |  |  | 		auto button2 = new EButton(new EText(L"<EFBFBD>ر<EFBFBD>"), [=]() { button->setEnable(!button->isEnable()); }); | 
					
						
							|  |  |  |  | 		button2->setPos(40, 40); | 
					
						
							|  |  |  |  | 		scene->add(button2); | 
					
						
							| 
									
										
										
										
											2017-11-03 22:14:07 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-14 01:07:34 +08:00
										 |  |  |  | 		app.enterScene(scene); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		app.run(); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	return 0; | 
					
						
							|  |  |  |  | } |