Esempio n. 1
0
void Circle::SetRadius(float radius)
{
	m_radius = radius;
	//If circle has a render component, update it
	if (m_renderComponent)
		UpdateRenderComponent();
}
Esempio n. 2
0
void BaseWidget::Update(double deltaSeconds) {
	
	//consider, not updating at all if hidden
	
	WidgetStateProperties& currentStateProperties = GetCurrentStateProperties();

	//calls this widget's update event
	std::string updateEventNameStr = "";
	currentStateProperties.GetProperty("updateEvent", updateEventNameStr);
	if (updateEventNameStr != "") {
		NamedProperties updateEventParams;
		updateEventParams.Set("widgetInstance", this);
		updateEventParams.Set("deltaSeconds", deltaSeconds);
		EventSystem::GetInstance().FireEvent(updateEventNameStr, updateEventParams);
	}

	ProcessInput(deltaSeconds);
	
	currentStateProperties.Update(deltaSeconds);

	//optimize: only update if it is rendering, or if it is dirty
	if (!m_isHidden) {
		UpdateRenderComponent(deltaSeconds);
		SetUICollider2DComponent();
	}
}
Esempio n. 3
0
void Circle::SetCenter(glm::vec3 position)
{
	m_center = position;
	//If circle has a render component, update it
	if (m_renderComponent != 0)
		UpdateRenderComponent();
	
}