void Button::Draw() const { DrawRectGraph( static_cast<int>(m_pos.x), static_cast<int>(m_pos.y), 0, 0, static_cast<int>(m_size.x), static_cast<int>(m_size.y), ImageHandleOf(static_cast<ImageType>(m_image_handle)), TRUE, FALSE); // DrawTexture( m_pos , static_cast<ImageType>(m_image_handle) ); DrawCollision(); DrawFormatString( (int)m_pos.x , (int)m_pos.y, ColorOf(0,255,0) , "%s", m_name.c_str() ); }
void Minigame::WaitingDraw() { if (lmState) { GLVECTOR2 beg = ball->getPos(); GLVECTOR2 vec = Engine()->GetLmDevice()->LMGetVector(); vec.x *= -2; vec.y *= -2; GLVECTOR2 end = VectorOf(beg.x + vec.x, beg.y + vec.y); Engine()->GetGlDevice()->DrawArrow(beg, end, 8, ColorOf(0.0f, 1.0f, 0.0f)); } Engine()->GetPhysDevice()->Draw(Engine()->GetGlDevice()); }
void Ball::Draw(PGLENGINE glEngine) { GLVECTOR2 end; double mag = Magnitude(Vel); end.x = Pos.x + Vel.x * 6.0; end.y = Pos.y + Vel.y * 6.0; float r = (float)mag / 50; if (r > 1.0) r = 1.0; glEngine->DrawArrow(this->Pos, end, 4.0f, ColorOf(r, 1.0f - r, 0.0f)); //glEngine->DrawCircle(this->Pos, VectorOf(this->radius, 0), ColorOf(0.95f, 0.95f, 0.95f)); glEngine->DrawTexturedRect(this->Pos, VectorOf(this->radius, this->radius), Engine()->GetString("ball_tex")); }
void UnitBase::DrawUnit( bool is_walk , bool is_attack) { DrawGraphInCamera( Vector2( ( GetPos().x - mImageSize.x / 2 ), ( GetPos().y - GetHeight() - mImageSize.y ) ), mImageSize, mAnimIndex + (is_walk ? 2 : 0) + (is_attack ? 4 : 0), mImageType, TRUE, ( mDir.x < 0.0f ) ); //HP DrawBox( static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25), static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y ), static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x + 25 ), static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + 4 ), GetColor(255,0,0) , TRUE); DrawBox( static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25), static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y ), static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25 + (50 * mHP / mHPMax) ), static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + 4 ), GetColor(0,255,0) , TRUE); if( IsVisibleCollision() ){ // コリジョン DrawBox( static_cast<int>( GetPos().x - GetSize().x / 2 + gCamera2D().GetDrawOffset().x ), static_cast<int>( GetPos().y - GetSize().y / 2 + gCamera2D().GetDrawOffset().y ), static_cast<int>( GetPos().x + GetSize().x / 2 + gCamera2D().GetDrawOffset().x ), static_cast<int>( GetPos().y + GetSize().y / 2 + gCamera2D().GetDrawOffset().y ), ColorOf(255,0,0), FALSE ); } if( IsDamaged() ){ SetFontSize(32); DrawFormatString( static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x + 32), static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + ( - 150 + mDamageFrame ) / 2 ), GetColor(255,255,0) , "%d", mDamage ); } }
void Minigame::Draw() { Engine()->GetGlDevice()->BeginScene(); Engine()->GetGlDevice()->DrawTexturedRect(VectorOf(Engine()->ScreenX() / 2, Engine()->ScreenY() / 2), VectorOf(Engine()->ScreenX(), Engine()->ScreenY()), Engine()->GetString("bg_tex")); switch (GameState) { case Minigame::WAITING: WaitingDraw(); break; case Minigame::RUNNING: RunningDraw(); break; case Minigame::WINNING: WinningDraw(); break; default: break; } char buffer[200]; sprintf(buffer, "Difficulty : %d | Move : %d | Level : %d", Engine()->GetInt("difficulty") , NumMoves, Level); Engine()->GetGlDevice()->DrawTextGl(VectorOf(Engine()->ScreenX() - 300, 6), ColorOf(0.0f, 0.0f, 0.0f), buffer); Engine()->GetGlDevice()->EndScene(); }
void StateCharacterGenerate::Update() { DrawFormatString( 0 , 0 , ColorOf(0,255,0) , "キャラ生成テスト:Enterで再生成"); char const* status_name[] = { "HP ", "ATK", "DEF", "SPD", "TEC", "LUK", }; assert( StatusType_Num == ARRAY_SIZE(status_name) ); DrawFormatString( 0, 20 , ColorOf(255,255,255), "id:%03d", mUnitStatus.mID ); int const kBaseY = 40; for( int i = 0 ; i < StatusType_Num ; i++ ){ for( int j = 0 ; j < mUnitStatus.mStatus[i] ; j++ ){ int color = ColorOf(255,255,255); if( mUnitStatus.mStatus[i] >= 15 ){ color = ColorOf(250,0,0); }else if( mUnitStatus.mStatus[i] >= 12 ){ color = ColorOf(250,250,0); }else if( mUnitStatus.mStatus[i] <= 7 ){ color = ColorOf(0,0,250); } DrawFormatString( 50 + j * 12 , kBaseY + i*10 , color ,"■" ); } DrawFormatString( 0, kBaseY + i*10, ColorOf(255,255,255), "%s:%03d", status_name[i], mUnitStatus.mStatus[i] ); } if( KeyInput()->IsTrig( InputKey::Type_Enter ) ){ mUnitStatus.SetRandom(mGenerateNum); mGenerateNum++; } }