Ejemplo n.º 1
0
void Font::update()
{
	getINDIEntity()->setText(_text.c_str());
	getINDIEntity()->setPosition(getPosition().getX(), getPosition().getY(), getPosition().getZ());
	getINDIEntity()->setAlign(IND_LEFT);
	getINDIEntity()->setTint(120, 120, 120);
}
void StaticGameEntity::Destroy()
{
	if (getINDIEntity() != NULL){
		getMasterInstance()->_entity2dManager->remove(getINDIEntity());
		getMasterInstance()->_surfaceManager->remove(_surface);
		getINDIEntity()->destroy();
	}
}
void AnimatedGameEntity::Draw()
{	
	float mPosX = 350;
	float mPosY = 250;
	getINDIEntity()->setAnimation(_animation);
	getINDIEntity()->setHotSpot(0.5f, 0.5f);
	getINDIEntity()->setScale(0.15f,0.15f);
	getINDIEntity()->setPosition((float)mPosX, (float)mPosY, 5);//(getPosition().getX(), getPosition().getY(), getPosition().getZ());
}
Ejemplo n.º 4
0
void HUD::draw()
{
	StaticGameEntity::draw();

	_healthBar->draw();
	_shootBar->draw();

	float windowHeight = getMasterInstance()->_window->getHeight();
	float windowWidth = getMasterInstance()->_window->getWidth();
	float scaleFactor = 0.40f;

	this->setPosition(Position3D(windowWidth / 2 - (getINDIEntity()->getRegionWidth()*0.5f) / 2, 0, this->getPosition().getZ()));

	this->getINDIEntity()->setScale(0.5f, 0.50f);

	float y = windowHeight - (_healthBar->getINDIEntity()->getRegionHeight() * scaleFactor);

	_healthBar->setPosition(Position3D(0, y, this->getPosition().getZ()));

	float x = windowWidth - _shootBar->getINDIEntity()->getRegionWidth() * scaleFactor;
	_shootBar->setPosition(Position3D(x, y, this->getPosition().getZ()));

	_healthBar->getINDIEntity()->setScale(scaleFactor, scaleFactor);
	_shootBar->getINDIEntity()->setScale(scaleFactor, scaleFactor);
}
GameEntity::~GameEntity()
{
    _masterInstance->_entity2dManager->remove(getINDIEntity());

    if (_entity)
        _entity->destroy();

    _entity = 0;
}
void AnimatedGameEntity::setPosition(float x, float y, float z)
{
	if (getINDIEntity())
		getINDIEntity()->setPosition(x, y, z);
}
void AnimatedGameEntity::setAngleXYZ(float x, float y, float z)
{
	if (getINDIEntity())
		getINDIEntity()->setAngleXYZ(x, y, z);
}
void AnimatedGameEntity::setNumReplays(int numreplays)
{
	if (getINDIEntity())
		getINDIEntity()->setNumReplays(numreplays);
}
void AnimatedGameEntity::setSequence(int sequence)
{
	if(getINDIEntity())
		getINDIEntity()->setSequence(sequence);
}
void StaticGameEntity::Draw()
{
	getINDIEntity()->setSurface(_surface);
	getINDIEntity()->setPosition(getPosition().getX(), getPosition().getY(), getPosition().getZ());
}
void AnimatedGameEntity::Draw()
{
	getINDIEntity()->setAnimation(_animation);
	getINDIEntity()->setScale(0.15f,0.15f);
	getINDIEntity()->setPosition(340, 240, 5);//(getPosition().getX(), getPosition().getY(), getPosition().getZ());
}