| 
									
										
										
										
											2018-08-13 23:47:10 +08:00
										 |  |  | #include "..\e2dbase.h"
 | 
					
						
							|  |  |  | #include "..\e2dnode.h"
 | 
					
						
							|  |  |  | #include "..\e2dmanager.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Scene::Scene() | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | 	: _borderVisible(false) | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	, _colliderVisible(false) | 
					
						
							| 
									
										
										
										
											2018-08-13 23:47:10 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 	_parentScene = this; | 
					
						
							| 
									
										
										
										
											2018-08-13 23:47:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Scene::~Scene() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | void e2d::Scene::showBorder(bool visible) | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | 	_borderVisible = visible; | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | void e2d::Scene::showCollider(bool visible) | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	_colliderVisible = visible; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | void e2d::Scene::visit() | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 	Node::visit(); | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | 	if (_borderVisible) | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | 		Renderer::getInstance()->getRenderTarget()->SetTransform(D2D1::Matrix3x2F::Identity()); | 
					
						
							|  |  |  | 		Renderer::getInstance()->getSolidColorBrush()->SetOpacity(1.f); | 
					
						
							|  |  |  | 		this->_drawBorder(); | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	if (_colliderVisible) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 		Renderer::getInstance()->getRenderTarget()->SetTransform(D2D1::Matrix3x2F::Identity()); | 
					
						
							| 
									
										
										
										
											2018-09-01 23:00:08 +08:00
										 |  |  | 		this->_drawCollider(); | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } |