Background::Background() : Sprite(Texture::ID::Background) , mCenter(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0) { SetPivot(mCenter); SetRotationRad(0, 0, D3DX_PI); }
Bumper::Bumper() : AllBumpers(Texture::ID::Bumper) , mCenter(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0) , mPos(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0) { SetPivot(mCenter); this->SetID(Components::Bumper); }
BOOL GcEditorTextureListBox::OnBeforeRemoveItem(int iItem) { if( iItem != -1 ) { delete GetTextureInfos()->GetAt( iItem ); GetTextureInfos()->RemoveAtAndFillAll( iItem ); } return GcVSListBox::OnBeforeRemoveItem( iItem ); }
Text::Text(Texture::ID id, D3DXVECTOR2 pos, bool visibility) : Sprite(id) , mCenter(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0.f ) { SetPivot(mCenter); SetRotationRad(D3DX_PI, 0.f, D3DX_PI); SetVisible(visibility); SetPosition(pos.x + mCenter.x, pos.y - mCenter.y); }
PigPeg::PigPeg() : Sprite(Texture::PIGPEG) { //Setting ID, initial position, pivot, collider and rotate it so the sprite is not upside down. this->SetID(Components::PigPeg); float radius = 8; collider = new CCircle(this, 0, 0, radius); SetPivot(D3DXVECTOR3(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0)); SetRotationDeg(0, 0, 180.f); }
Basket::Basket() :Sprite(Texture::BASKET) , posX(0.0f) , posY(-230.0f) , speed(100.0f) , center(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0.0f) , dir(1.0f) { // Place in world SetPosition(posX, posY); SetPivot(¢er); SetRotation(0.0f, 0.0f, 180*(D3DX_PI / 180)); }
void GcEditorTextureListBox::SetTextureInfo(CString strFilePath, float fSartTime, float fEndTime) { TextureListInfo::TextureInfo* info = new TextureListInfo::TextureInfo(); info->SetTextureName( strFilePath.GetString() ); info->SetStartTime( fSartTime ); info->SetEndTime( fEndTime ); GetTextureInfos()->Add( info ); }
Canon::Canon() : Sprite(Texture::ID::Canon) , mCenter(GetTextureInfos()->infos.Width / 2, GetTextureInfos()->infos.Height / 2, 0) , shotRot(0) , canonRot(D3DX_PI / 2) , ROTATION_SPEED(0.1) , isShot(false) , waitTime(0.f) , isGainLife(false) , waitGainLife(0.f) , shotDirection(0.f, 0.f, 0.f) , nbBalls(3) { SetPivot(mCenter); SetRotationRad(0.f, 0.f, canonRot); SetPosition(0, gApp->GetParam().BackBufferHeight / 2); hudLives = new HUDLives(); hudLives->UpdateLives(nbBalls); }
void GcEditorTextureListBox::OnAfterMoveItemDown(int iItem) { GetTextureInfos()->ChangePostion( iItem, iItem - 1 ); GcVSListBox::OnAfterMoveItemDown( iItem ); }
void GcEditorTextureListBox::RenameTexturePath(int iSelItme, CString strFilePath) { GetTextureInfos()->GetAt(iSelItme)->SetTextureName( strFilePath.GetString() ); }