| 
									
										
										
										
											2018-08-13 23:47:10 +08:00
										 |  |  | #include "..\e2dbase.h"
 | 
					
						
							|  |  |  | #include "..\e2dnode.h"
 | 
					
						
							|  |  |  | #include "..\e2dmanager.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Scene::Scene() | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 	: _outlineVisible(false) | 
					
						
							|  |  |  | 	, _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-08-23 16:37:51 +08:00
										 |  |  | void e2d::Scene::setOutlineVisible(bool visible) | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	_outlineVisible = visible; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-23 16:37:51 +08:00
										 |  |  | void e2d::Scene::setColliderVisible(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
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (_outlineVisible) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 		auto brush = Renderer::getInstance()->getSolidColorBrush(); | 
					
						
							| 
									
										
										
										
											2018-08-19 15:11:20 +08:00
										 |  |  | 		brush->SetColor(D2D1::ColorF(D2D1::ColorF::Red, 0.6f)); | 
					
						
							|  |  |  | 		brush->SetOpacity(1.f); | 
					
						
							| 
									
										
										
										
											2018-08-28 00:06:10 +08:00
										 |  |  | 		this->drawOutline(); | 
					
						
							| 
									
										
										
										
											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-08-19 15:11:20 +08:00
										 |  |  | 		this->drawCollider(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |