Esempio n. 1
0
void BiPlaneGameUI::addPlayerSpeedo(void) {
	// Get the ID Handling singlton
	MyIdHandler* mih = &MyIdHandler::get();

	// Grab some ID's for the speedo and needle (one for the image, one for the sprite)
	this->speedoImageId = mih->getImageId();
	this->speedoSpriteId = mih->getSpriteId();
	this->speedoNeedleImageId = mih->getImageId();
	this->speedoNeedleSpriteId = mih->getSpriteId();

	// Load the resources
	dbLoadImage("Media/speedo.png", this->speedoImageId, 1);
	dbLoadImage("Media/needle.png", this->speedoNeedleImageId, 1);

	// Define the speedo sprite
	dbSprite(this->speedoSpriteId, 0, 0, this->speedoImageId);
	dbHideSprite(this->speedoSpriteId);
	dbSetSpriteAlpha(this->speedoSpriteId, 33);

	// Define the needle sprite, offsetting it's center so it pivots nicely
	dbSprite(this->speedoNeedleSpriteId, 0, 0, this->speedoNeedleImageId);
	dbHideSprite(this->speedoNeedleSpriteId);
	dbOffsetSprite(this->speedoNeedleSpriteId, 43, 12);
	dbSetSpriteAlpha(this->speedoNeedleSpriteId, 33);

	// Define the position of the speedo...
	this->speedoX = dbScreenWidth() - dbSpriteWidth(this->speedoSpriteId) - 16;
	this->speedoY = dbScreenHeight() - dbSpriteHeight(this->speedoSpriteId) - 16;

	// ... an the needle
	this->needleX = this->speedoX + (dbSpriteWidth(this->speedoSpriteId) / 2);
	this->needleY = this->speedoY + (dbSpriteHeight(this->speedoSpriteId) / 2);
}
Esempio n. 2
0
void MSvstar::sleep()
{
     dbHideSprite(spriteNO);
	active = 0;//sleeped
}
Esempio n. 3
0
void MaudioButton::sleep()
{
	dbHideSprite(spriteNO);
	active = 0;//sleeped
}
Esempio n. 4
0
void Mobstacle::sleep()
{
    dbHideSprite(spriteNO);
	active = 0;//sleeped
}