| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | #include "..\etransitions.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-09 15:27:11 +08:00
										 |  |  | #include "..\enodes.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-27 21:07:43 +08:00
										 |  |  | e2d::TransitionEmerge::TransitionEmerge(double duration) | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  | 	: Transition(duration) | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  | void e2d::TransitionEmerge::_update() | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-30 16:45:38 +08:00
										 |  |  | 	this->_calcRateOfProgress(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (m_pPrevScene) m_pPrevScene->getRoot()->setOpacity(1 - m_fRateOfProgress); | 
					
						
							|  |  |  | 	m_pNextScene->getRoot()->setOpacity(m_fRateOfProgress); | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-30 16:45:38 +08:00
										 |  |  | 	if (m_fRateOfProgress >= 1) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		this->_stop(); | 
					
						
							| 
									
										
										
										
											2017-12-09 15:27:11 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  | void e2d::TransitionEmerge::_init() | 
					
						
							| 
									
										
										
										
											2017-12-09 15:27:11 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (m_pPrevScene) m_pPrevScene->getRoot()->setOpacity(1); | 
					
						
							|  |  |  | 	m_pNextScene->getRoot()->setOpacity(0); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 16:37:12 +08:00
										 |  |  | void e2d::TransitionEmerge::_reset() | 
					
						
							| 
									
										
										
										
											2017-12-09 15:27:11 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (m_pPrevScene) m_pPrevScene->getRoot()->setOpacity(1); | 
					
						
							|  |  |  | 	m_pNextScene->getRoot()->setOpacity(1); | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | } |