Ejemplo n.º 1
0
void BrickParticle::draw(Bengine::SpriteBatch & spriteBatch)
{
	static int textureID = Bengine::ResourceManager::getTexture("Textures/brick.png").id;
	const glm::vec4 uvRect(0.0f, 0.0f, 1.0f, 1.0f);
	glm::vec4 destRect(m_position.x, m_position.y, m_width, m_height);
	spriteBatch.draw(destRect, uvRect, textureID, 0.0f, Bengine::ColorRGBA8(2, 29, 39, 255));
}
Ejemplo n.º 2
0
void Box::draw(Bengine::SpriteBatch& spriteBatch) {
    glm::vec4 destRect;
    destRect.x = m_body->GetPosition().x - m_dimensions.x / 2.0f;
    destRect.y = m_body->GetPosition().y - m_dimensions.y / 2.0f;
    destRect.z = m_dimensions.x;
    destRect.w = m_dimensions.y;
    spriteBatch.draw(destRect, m_uvRect, m_texture.id, 0.0f, m_color, m_body->GetAngle());
}
Ejemplo n.º 3
0
void ManaShield::draw(Bengine::SpriteBatch& spriteBatch, float x, float y)
{
	glm::vec4 uv(0.0f, 0.0f, 1.0f, 1.0f);
	Bengine::ColorRGBA8 color((sin(_timer * 10) + 1) / 2 * 200 + 50, (sin(_timer * 15) + 1) / 2 * 200 + 50, (sin(_timer * 20) + 1) / 2 * 200 + 50, 200);
	
	if (_active)
		spriteBatch.draw(glm::vec4(x * CAMERA.getScreenDimensions().x / 32, y * CAMERA.getScreenDimensions().y / 18, CAMERA.getScreenDimensions().x / 32 * 1.6, CAMERA.getScreenDimensions().y / 18 * 1.6), _rotation, uv, _texture.id, 0.0f, color);
	

}
Ejemplo n.º 4
0
Archivo: Agent.cpp Proyecto: snikk/Junk
void Agent::draw(Bengine::SpriteBatch& _spriteBatch) {

    static int textureID = Bengine::ResourceManager::getTexture("Textures/circle.png").id;

    const glm::vec4 uvRect(0.0f, 0.0f, 1.0f, 1.0f);

    glm::vec4 destRect;
    destRect.x = _position.x;
    destRect.y = _position.y;
    destRect.z = AGENT_WIDTH;
    destRect.w = AGENT_WIDTH;

    _spriteBatch.draw(destRect, uvRect, textureID, 0.0f, _color);
}
Ejemplo n.º 5
0
void Homura::draw(Bengine::SpriteBatch& spriteBatch){

	//draw the mana bar -----------------------------------------------------------------------------------------------------------------
	static Bengine::GLTexture manaBarBG = Bengine::ResourceManager::getTexture("Textures/Character/manaBarBG.png");
	static Bengine::GLTexture manaBarTick = Bengine::ResourceManager::getTexture("Textures/Character/manaBarTick.png");
	static Bengine::GLTexture manaBarFrame = Bengine::ResourceManager::getTexture("Textures/Character/manaBarFrame.png");
	glm::vec4 uv(0.0f, 0.0f, 1.0f, 1.0f);

	if (_alive)
	{
		spriteBatch.draw(glm::vec4(_body->GetPosition().x * TheMainGame::Instance()->_camera.getScreenDimensions().x / 32,
			_body->GetPosition().y * TheMainGame::Instance()->_camera.getScreenDimensions().y / 18 + TheMainGame::Instance()->_camera.getScreenDimensions().y / 18,
			TheMainGame::Instance()->_camera.getScreenDimensions().x / 16.7320261438, TheMainGame::Instance()->_camera.getScreenDimensions().y / 36), 0.0f, uv, manaBarBG.id, 0.0f, color);

		for (int i = 0; i < _mana; i++)
		{
			spriteBatch.draw(glm::vec4(_body->GetPosition().x * TheMainGame::Instance()->_camera.getScreenDimensions().x / 32 - TheMainGame::Instance()->_camera.getScreenDimensions().x / 34.1333333333 + (TheMainGame::Instance()->_camera.getScreenDimensions().x / 1706.66666667 * i),
				_body->GetPosition().y * TheMainGame::Instance()->_camera.getScreenDimensions().y / 18 + TheMainGame::Instance()->_camera.getScreenDimensions().y / 18,
				TheMainGame::Instance()->_camera.getScreenDimensions().x / 1706.66666667, TheMainGame::Instance()->_camera.getScreenDimensions().y / 36), 0.0f, uv, manaBarTick.id, 0.0f, color);
		}

		spriteBatch.draw(glm::vec4(_body->GetPosition().x * TheMainGame::Instance()->_camera.getScreenDimensions().x / 32,
			_body->GetPosition().y * TheMainGame::Instance()->_camera.getScreenDimensions().y / 18 + TheMainGame::Instance()->_camera.getScreenDimensions().y / 18,
			TheMainGame::Instance()->_camera.getScreenDimensions().x / 16.7320261438, TheMainGame::Instance()->_camera.getScreenDimensions().y / 36), 0.0f, uv, manaBarFrame.id, 0.0f, color);

		//---------------------------------------------------------------------------------------------------------------------

		_manaShield->draw(spriteBatch, _body->GetPosition().x, _body->GetPosition().y);
		_currentState->draw(spriteBatch, _body);
		_mainWeaponState->draw(spriteBatch, _body->GetPosition().x, _body->GetPosition().y);
	}




}
Ejemplo n.º 6
0
void Bullet::draw(Bengine::SpriteBatch& spriteBatch) {
    glm::vec4 destRect(_position.x + BULLET_RADIUS,
                       _position.y + BULLET_RADIUS,
                       BULLET_RADIUS * 2,
                       BULLET_RADIUS * 2);
    const glm::vec4 uvRect(0.0f, 0.0f, 1.0f, 1.0f);

    Bengine::ColorRGBA8 color;
    color.r = 75;
    color.g = 75;
    color.b = 75;
    color.a = 255;

    spriteBatch.draw(destRect, uvRect, Bengine::ResourceManager::getTexture("Textures/circle.png").id, 0.0f, color);
}