// 背景の描画 void title::disp_title() { // TIPS: 色合いが気に入らないので、最背面に別の色をこっそり描画 drawFillBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT, win::color(paint::White)); // 海 drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT, anime.scroll_ * 2, 0, size::Sea_W, size::Sea_H, sea_, win::color(paint::White, 0.5f)); // 波 drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT, anime.scroll_, 0, size::Sea_W, size::Sea_H, fog_, win::color(paint::SkyBlue, 0.5f)); // 大陸 drawTextureBox(0, 0, size::WIDTH, size::HEIGHT, 0, 0, size::World_W, size::World_H, bg_, win::color(paint::Black), 0, Vec2f(1.01f, 1.01f), Vec2f(size::Half_W, size::Half_H)); drawTextureBox(-size::Half_W, -size::Half_H, size::WIDTH, size::HEIGHT, 0, 0, size::World_W, size::World_H, bg_, win::color(paint::Orange)); // ロゴ drawTextureBox(0, size::LogoPos_Y, size::Logo_W, size::Logo_H, 0, size::Logo_H * anime.blink_, size::Logo_W, size::Logo_H, logo_, win::color(paint::White), 0, Vec2f(3.f, 3.f), Vec2f(size::Logo_W / 2, 0)); }
void ending(int& sceen){ Texture message = Texture("res/mese-ji.png"); Texture jijii = Texture("res/jijii.png"); Texture con = Texture("res/kongura.png"); Font font = ("res/meiryo.ttc"); std::string text1 = "いい人生じゃった最後までやってくれて"; std::string text2 = "本当にありがとうございました"; Media clear = Media ("res/se/clear.wav"); clear.play(); while (sceen == 3) { if (!env.isOpen()) exit(0); env.begin(); env.bgColor(Color::black); if (env.isPushKey(GLFW_KEY_ENTER)){ sceen = 0; } drawTextureBox(-1024, -312, 2048, 1024, 0, 0, 2048, 1024, jijii); drawTextureBox(-1024, -512, 2048, 1024, 0, 0, 2048, 1024, message); drawTextureBox(-1024, 0, 2048-400, 256-50, 0, 0, 2048, 256, con); font.size(100); font.draw(text1, Vec2f(-900, -300), Color::white); font.draw(text2, Vec2f(-900, -400), Color::white); font.size(30); env.end(); } }
void GameMain::Draw(){ App::Get().bgColor(Color::maroon); drawTextureBox(-360, -480, 720, 960, 0, 0, 720, 960, ResTex.Get(TextureKey::GameBG)); drawTextureBox(-360, -580, 720, 960, 0, 0, 720, 960, ResTex.Get(TextureKey::GameTomoko)); if (is_game_end != true){ DisplayedTimer(time_limit); } else{ /* "終了"の文字表記 */ } for (int i = 0; i < 3; i++) { drawTextureBox(plates[i].pos.x(), plates[i].pos.y(), plates[i].size.x(), plates[i].size.y(), 0, 0, 512, 512, ResTex.Get(TextureKey::Plate)); food[i]->Draw(); } for (auto itr : selected){ itr.Draw(); } }
void FallBlock::draw() { if (color_type == CONDITION::WHITE) drawTextureBox(block.pos.x(), block.pos.y(), block.size.x(), block.size.y(), 0, 0, 32, 32, image_white); if (color_type == CONDITION::BLACK) drawTextureBox(block.pos.x(), block.pos.y(), block.size.x(), block.size.y(), 0, 0, 32, 32, image_black); }
// タイトル画面 void game_title(AppEnv& app_env) { // 画像読み込み Texture title("res/png/sys01_logo.png"); // タイトルロゴ Texture start("res/png/sys02_start.png"); // スタートボタン Texture BG("res/png/bg01_gradation.png"); // 背景 // この処理内だけで使う変数 const short One_Second = 60; // 1秒 = 60.frame const short Logo_Line = 8; // 描画サイズ const short Draw_Limit = Logo_Ha - Logo_Line; // 描画アニメの終了判定 short time_count = 0; // タイマー short blink = 0; // 点滅アニメーション float draw_y = 0; // ロゴ変化アニメ:描画位置 while (1) { if (!app_env.isOpen()) { return; } // 左クリックでループ終了 if (app_env.isPushButton(Mouse::LEFT)) { app_env.flushInput(); return; } // 画像の点滅処理 { blink = (time_count / 30) % 2; time_count++; if (time_count == One_Second) { time_count = 0; } // 1秒カウントしたらリセット } // タイトルロゴに変化をつける処理 { draw_y += 1.5; if (draw_y >= Draw_Limit) { draw_y = 0; } // 描画位置をリセット } app_env.setupDraw(); // 背景表示 drawTextureBox((-Window::WIDTH / 2), (-Window::HEIGHT / 2), Window::WIDTH, Window::HEIGHT, 0, 0, Bg_W, Bg_H, BG, Color(0, 0, 0, 0.5)); // タイトルロゴ表示 drawTextureBox((-Logo_W * 1), (Logo_Ha * 1), Logo_W * 2, Logo_Ha, 0, 0, Logo_W, Logo_Ha, title, Color(1, 0.75, 0.5)); drawTextureBox((-Logo_W * 1), (Logo_Ha * 1) + draw_y, Logo_W * 2, Logo_Line, 0, (Logo_Ha - Logo_Line) - draw_y, Logo_W, Logo_Line, title, Color(1, 1, 1)); // クリックスタート drawTextureBox((-Logo_W * 0.5), (-Logo_Hb * 2), Logo_W, Logo_Hb, 0, 0, Logo_W, Logo_Hb, start, Color(1, 1, 0.5, blink)); app_env.update(); } }
void Bow::draw() { if (is_draw == true) drawTextureBox(getPos().x() - getSize().x() / 2, getPos().y() - getSize().y() / 2, getSize().x(), getSize().y(), cut_pos.x() + cut_size.x() * index, cut_pos.y(), cut_size.x(), cut_size.y(), Textures::get("BowObj"), Color(color.x(), color.y(), color.z())); else if (player_direction == 1) { drawTextureBox(getPos().x() - getSize().x() / 2 + 2.0f, getPos().y() + 8.0f, getSize().x(), getSize().y(), cut_pos.x() + cut_size.x() * index, cut_pos.y(), cut_size.x(), cut_size.y(), Textures::get("Bow"), Color(color.x(), color.y(), color.z()), rad, Vec2f(1.0f, 1.0f), Vec2f(2.0f, getSize().y() / 2.0f + 5.0f)); } else if (player_direction == -1) { drawTextureBox(getPos().x() - getSize().x() / 2 + 8.0f, getPos().y() + 8.0f, getSize().x(), getSize().y(), cut_pos.x() + cut_size.x() * index, cut_pos.y(), cut_size.x(), cut_size.y(), Textures::get("Bow"), Color(color.x(), color.y(), color.z()), -rad, Vec2f(-1.0f, 1.0f), Vec2f(2.0f, getSize().y() / 2.0f + 5.0f)); } //予測線 if (index == 2 && bow_status == BowStatus::DRAW) { if (player_direction == 1) drawLine(getPos().x() - 25.0f, getPos().y() + 8.0f, getPos().x() - 25.0f + arrow_vec.x() * 5.0f, getPos().y() + 8.0f + (arrow_vec.y() * 5.0f), 5, Color(1.0f, 1.0f, 0.0f, 0.5f)); else if (player_direction == -1) drawLine(getPos().x() - 15.0f, getPos().y() + 7.0f, getPos().x() - 15.0f + arrow_vec.x() * 5.0f * -1.0f, getPos().y() + 7.0f + (arrow_vec.y() * 5.0f), 5, Color(1.0f, 1.0f, 0.0f, 0.5f)); } /*仮置き*/ }
void UIManager::DrawOfMenuUI() { drawFillBox(menuUI.Position().x(), menuUI.Position().y(), menuUI.Size().x(), menuUI.Size().y(), Color::black); drawTextureBox(menuUI.Position().x(), menuUI.Position().y(), menuUI.Size().x(), menuUI.Size().y(), 10, 370, 990, 654, *textureManager.Find("Flame")); drawTextureBox(menuUI.Position().x(), menuUI.Position().y(), menuUI.Size().x(), menuUI.Size().y(), 0, 0, 512, 256, *textureManager.Find("MenuText")); if (isSelectingMenu == true) { drawFillBox(-WINDOW_WIDTH / 2, -WINDOW_HEIGHT / 2, WINDOW_WIDTH, WINDOW_HEIGHT, Color(0, 0, 0, 0.6f)); drawTextureBox(menuOfBackSelectStageUI.Position().x() + 30, 300, menuOfBackSelectStageUI.Size().x() - 60, menuOfBackSelectStageUI.Size().y(), 0, 0, 512, 256, *textureManager.Find("MenuText")); drawFillBox(menuOfResetStageUI.Position().x(), menuOfResetStageUI.Position().y(), menuOfResetStageUI.Size().x(), menuOfResetStageUI.Size().y(), Color::black); drawTextureBox(menuOfResetStageUI.Position().x(), menuOfResetStageUI.Position().y(), menuOfResetStageUI.Size().x(), menuOfResetStageUI.Size().y(), 10, 370, 990, 654, *textureManager.Find("Flame")); drawTextureBox(menuOfResetStageUI.Position().x() + 35, menuOfResetStageUI.Position().y() + 20, menuOfResetStageUI.Size().x() - 70, menuOfResetStageUI.Size().y() - 40, 0, 0, 512, 256, *textureManager.Find("ResetStageText")); drawFillBox(menuOfBackSelectStageUI.Position().x(), menuOfBackSelectStageUI.Position().y(), menuOfBackSelectStageUI.Size().x(), menuOfBackSelectStageUI.Size().y(), Color::black); drawTextureBox(menuOfBackSelectStageUI.Position().x(), menuOfBackSelectStageUI.Position().y(), menuOfBackSelectStageUI.Size().x(), menuOfBackSelectStageUI.Size().y(), 10, 370, 990, 654, *textureManager.Find("Flame")); drawTextureBox(menuOfBackSelectStageUI.Position().x() + 20, menuOfBackSelectStageUI.Position().y(), menuOfBackSelectStageUI.Size().x() - 40, menuOfBackSelectStageUI.Size().y(), 0, 0, 512, 256, *textureManager.Find("BackStageSelectText")); drawFillBox(menuOfReturnGameUI.Position().x(), menuOfReturnGameUI.Position().y(), menuOfReturnGameUI.Size().x(), menuOfReturnGameUI.Size().y(), Color::black); drawTextureBox(menuOfReturnGameUI.Position().x(), menuOfReturnGameUI.Position().y(), menuOfReturnGameUI.Size().x(), menuOfReturnGameUI.Size().y(), 10, 370, 990, 654, *textureManager.Find("Flame")); drawTextureBox(menuOfReturnGameUI.Position().x() + 24, menuOfReturnGameUI.Position().y() + 10, menuOfReturnGameUI.Size().x() - 48, menuOfReturnGameUI.Size().y() - 20, 0, 0, 512, 256, *textureManager.Find("BackGameText")); } }
void UIManager::DrawOfPauseBar() { drawFillBox(pausingUI.Position().x(), pausingUI.Position().y(), pausingUI.Size().x(), pausingUI.Size().y(), Color::black); drawTextureBox(pausingUI.Position().x(), pausingUI.Position().y(), pausingUI.Size().x(), pausingUI.Size().y(), 10, 370, 990, 654, *textureManager.Find("Flame")); if (isPausing == true) drawTextureBox(pausingUI.Position().x() + 64, pausingUI.Position().y() + 14, 50, 50, 0, 0, 512, 512, *textureManager.Find("PlayButton")); else if (isPausing == false) drawTextureBox(pausingUI.Position().x() + 64, pausingUI.Position().y() + 14, 50, 50, 0, 0, 512, 512, *textureManager.Find("StopButton")); }
void EffectObject::Draw() { //if(drawTime > 0) drawTextureBox(position.x() - size.x() / 2, position.y() - size.y() / 2, size.x(), size.y(), 0, 0, cutSize.x(), cutSize.y(), image); }
void StageSelect::drawBackground() { Vec2f pos = Vec2f(0,-22); Vec2f size = Vec2f(1678, 825); drawTextureBox(pos.x(), pos.y(), size.x(), size.y(), 0, 0, background_tex_.width(), background_tex_.height(), background_tex_, Color::white, 0, Vec2f(1, 1), size / 2); }
void Title::Draw() { if (TitleAnimationCounter >= 2000) drawTextureBox(-500, -500, 1000, 1000, 0, 0, 1024, 1024, TitleBack); }
void UIManager::DrawOfSelectMapChipPos() { if(isTouchCharaMakeMapChip == true) drawTextureBox(selectMapPosition.x(), selectMapPosition.y(), MAP_CHIP_SIZE, MAP_CHIP_SIZE, 0, 0, 256, 256, *textureManager.Find("SummonField"), Color(1, 1, 1, 0.75f), -playerCanAttackSizeAngle, Vec2f(1, 1), Vec2f(MAP_CHIP_SIZE / 2, MAP_CHIP_SIZE / 2)); }
void SampleModel::drawFace() { glPushMatrix(); // eyes glTranslated(0.2, UPPER_TORSO_RADIUS + HEAD_RADIUS + 0.3, 0.7); if (VAL(TEXTURESKIN)) drawTextureSphere(0.1); else drawSphere(0.1); glTranslated(-0.4, 0, 0); if (VAL(TEXTURESKIN)) drawTextureSphere(0.1); else drawSphere(0.1); // nose setDiffuseColor(.940f, .816f, .811f); glTranslated( 0.2, -0.3, 0.1); if (VAL(TEXTURESKIN)) drawTextureSphere(0.1); else drawSphere(0.1); glPopMatrix(); // mouth glPushMatrix(); setDiffuseColor(1.0f, 0.0f, 0.0f); glTranslated(-0.25, UPPER_TORSO_RADIUS + 0.3, 0.7); glRotated(20, 1.0, 0.0, 0.0); glTranslated(0.0, 0.0, -0.05); if (VAL(TEXTURESKIN)) drawTextureBox(0.5,0.3,0); else drawBox(0.5,0.3,0); glPopMatrix(); }
void Grass::draw() { drawTextureBox(pos.x() - size.x() / 2, pos.y() - size.y() / 2, size.x(), size.y(), 0, 0, 128, 128, Textures::get("grass")); }
void UIManager::DrawOfSummonEffect() { if (isSummon == true) drawTextureBox(summonEffectPos.x(), summonEffectPos.y(), summonEffectSize.x(), summonEffectSize.y(), 0, 0, 256, 256, *textureManager.Find("SummonField"),Color::white, summonEffectAngle,Vec2f(1,1),Vec2f(summonEffectSize.x()/2,summonEffectSize.y()/2)); }
void UIManager::Draw() { font.size(50); font.draw(std::to_string(GameManager::totalSummonPoint), Vec2f(-25, 435), Color::white); drawTextureBox(-110, 420, 90, 90, 0, 0, 256, 256, *textureManager.Find("Soul")); DrawOfUnderUI(); DrawOfEnemyStatus(); DrawOfMakingCharacter(); DrawOfPlayerLevel(); DrawofSelectingPlayerImage(); DrawOfPauseBar(); DrawOfChangeUpdateSpeedUI(); DrawOfWaveBar(); DrawOfCastleHP(); DrawOfMenuUI(); DrawOfChangedPanel(); }
void Metal::Draw(){ switch (variation){ case FoodVariation::Var1: drawTextureBox(box.pos.x(), box.pos.y(), box.size.x(), box.size.y(), 0, 0, 256, 256, ResTex.Get(TextureKey::Metal)); break; case FoodVariation::Var2: drawTextureBox(box.pos.x(), box.pos.y(), box.size.x(), box.size.y(), 256, 0, 256, 256, ResTex.Get(TextureKey::Metal)); break; case FoodVariation::Var3: drawTextureBox(box.pos.x(), box.pos.y(), box.size.x(), box.size.y(), 256, 256, 256, 256, ResTex.Get(TextureKey::Metal)); break; } }
void Option(int& scene, Font& font) { Texture bg = Texture("res/image/bg_ope.png"); //決定音 Media decision("res/sound/decision.wav"); while (scene == OPTION || decision.isPlaying()) { if (!env.isOpen()){ exit(0); } if (env.isPushKey(GLFW_KEY_ENTER)) { scene = TITLE; decision.play(); } env.begin(); //背景 drawTextureBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, 0, 0, 512, 285, bg); font.draw("もどる", Vec2f(800.0f, -400.0f) - font.drawSize("もどる") / 2, Color::olive); env.end(); } env.flushInput(); }
// 画像つき矩形の描画(回転、拡大縮小つき) // start_x, start_y 始点 // width, height 幅、高さ // start_tx, start_ty 画像切り抜き開始位置 // texture_width, texture_height 画像切り抜き幅、高さ // texture 画像 // color 色 // angle_rad 回転角度(ラジアン) // scaling 横、縦の拡大縮小率 // origin 矩形の原点位置 void drawTextureBox(const float start_x, const float start_y, const float width, const float height, const float start_tx, const float start_ty, const float texture_width, const float texture_height, const Texture& texture, const Color& color, const float angle_rad, const Vec2f& scaling, const Vec2f& origin) { // 回転、拡大縮小の行列を生成 auto matrix = transformMatrix2D(angle_rad, Vec3f(start_x, start_y, 0.0f), Vec3f(scaling.x(), scaling.y(), 1.0f)); // 行列をOpenGLに設定 glPushMatrix(); glMultMatrixf(matrix.data()); // 描画 drawTextureBox(-origin.x(), -origin.y(), width, height, start_tx, start_ty, texture_width, texture_height, texture, color); // 行列を元に戻す glPopMatrix(); }
void StageBlock::draw(const Vec2f& camera, Texture& texture) { // TIPS: カメラと自分の相対座標を求める const Vec2f DrawPos = pos - camera; drawTextureBox(DrawPos.x(), DrawPos.y(), scale.x(), scale.y(), 0, 0, texSize.x(), texSize.y(), texture, Color::white); }
void cShot::draw(){ drawTextureBox(pos_.x(), pos_.y(), size_.x(), size_.y(), cut_pos_.x(), cut_pos_.y(), cut_size_.x(), cut_size_.y(), pic_, Color(1, 1, 1), angle_, Vec2f(1, 1), Vec2f(size_ / 2)); }
void disp_value(float x, float y) { for (it = val.begin(), i = 0; it != val.end(); ++it, ++i) { drawTextureBox(x - i * (Num_W * 2), y, Num_W, Num_H, (*it) * Num_W, 0, Num_W, Num_H, *number, Color(1, 1, 1), 0, Vec2f(2, 2), Vec2f(Num_W / 2, Num_H / 2)); } }
void SampleModel::drawNeck() { glPushMatrix(); glTranslated(0, UPPER_TORSO_RADIUS + 0.1, 0); glScaled(0.4, 0.6, 0.4); glTranslated(-0.5, -0.5, -0.5); if (VAL(TEXTURESKIN)) drawTextureBox(1, 1, 1); else drawBox(1, 1, 1); glPopMatrix(); }
void UIManager::DrawofSelectingPlayerImage() { for (int i = 0; i < MAX_SELECT_CHARA_NUM; ++i) { if (isSelectSetPlayer == true && isHitMouseToBox(charaUI[i].Position(), charaUI[i].Size(), mousePosition) == true) { switch (i) { case PlayerCharaType::TUBAKI: drawTextureBox(selectMapPosition.x(), selectMapPosition.y(), 100 * 2, 100 * 2, 0, 0, 256, 256, *textureManager.Find("AttackField"), Color(1, 1, 1, 0.35f), playerCanAttackSizeAngle, Vec2f(1, 1), Vec2f(100, 100)); drawTextureBox(selectMapPosition.x() - 40, selectMapPosition.y() - 40, 80, 80, 0, 0, 256, 256, *textureManager.Find("Tubaki"), Color(1, 1, 1, 0.7f)); break; case PlayerCharaType::NOEL: drawTextureBox(selectMapPosition.x(), selectMapPosition.y(), 260 * 2, 260 * 2, 0, 0, 256, 256, *textureManager.Find("AttackField"), Color(1, 1, 1, 0.35f), playerCanAttackSizeAngle, Vec2f(1, 1), Vec2f(260 + 10, 260 + 10)); drawTextureBox(selectMapPosition.x() - 40, selectMapPosition.y() - 40, 80, 80, 0, 0, 256, 256, *textureManager.Find("Noel"), Color(1, 1, 1, 0.7f)); break; case PlayerCharaType::RACHEL: drawTextureBox(selectMapPosition.x(), selectMapPosition.y(), 320 * 2, 320 * 2, 0, 0, 256, 256, *textureManager.Find("AttackField"), Color(1, 1, 1, 0.35f), playerCanAttackSizeAngle, Vec2f(1, 1), Vec2f(320 + 10, 320 + 10)); drawTextureBox(selectMapPosition.x() - 40, selectMapPosition.y() - 40, 80, 80, 0, 0, 256, 256, *textureManager.Find("Rachel"), Color(1, 1, 1, 0.7f)); break; case PlayerCharaType::JIN: drawTextureBox(selectMapPosition.x(), selectMapPosition.y(), 100 * 2, 100 * 2, 0, 0, 256, 256, *textureManager.Find("AttackField"), Color(1, 1, 1, 0.35f), playerCanAttackSizeAngle, Vec2f(1, 1), Vec2f(100, 100)); drawTextureBox(selectMapPosition.x() - 40, selectMapPosition.y() - 40, 80, 80, 0, 0, 256, 256, *textureManager.Find("Jin"), Color(1, 1, 1, 0.7f)); break; default: break; } } } }
void NormalBlock::draw() { drawTextureBox(pos.x() - size.x() / 2, pos.y() - size.y() / 2, size.x(), size.y(), 0, 0, 128, 128, Textures::get("whiteblock")); }
void Result::Draw(){ if (iswin) { //drawFillBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, Color::red); drawTextureBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, 0, 0, 1024, 1024, win_texture); if (!winse.isPlaying()){ winse.play(); } } else { drawFillBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, Color::green); drawTextureBox(-WIDTH / 2, -HEIGHT / 2, WIDTH, HEIGHT, 0, 0, 1024, 1024, lose_texture); if (!loosse.isPlaying()){ loosse.play(); } } }
void Player::Draw(const Vec2f& camera) { ++animeTime; // TIPS: カメラと自分の相対座標を求める const Vec2f DrawPos = pos - camera; //DEBUG //drawFillBox(DrawPos.x(), DrawPos.y(), dot_scale.x(), dot_scale.y(), Color::white); // 必殺ゲージ { const float gaugeRatio = countTimer / (60.0f * 5); drawFillBox(-eg::Width / 2 + 20, 0, 50, eg::Height / 2 - 20, Color::black); drawFillBox(-eg::Width / 2 + 20, 0, 50, (eg::Height / 2 - 20) * gaugeRatio, Color::magenta); } // HP ゲージ { const float gaugeRatio = (float)hp / 10.0f; const float posY = DrawPos.y() + (isInvincible ? 150 : 100); drawFillBox(DrawPos.x() - 50, posY, 100, 20, Color::black); drawFillBox(DrawPos.x() - 50, posY, 100 * gaugeRatio, 20, Color::lime); } if (isInvincible == false) { const auto blink = (animeTime / 10) % 2; drawTextureBox(DrawPos.x(), DrawPos.y(), dot_scale.x(), dot_scale.y(), blink * texSize.x(), 0, texSize.x(), texSize.y(), dot, Color::white, 0.0f, Vec2f::Ones(), Vec2f(dot_scale.x() * 0.5f, 0)); } else { const auto blink = (animeTime / 5) % 3; drawTextureBox(DrawPos.x(), DrawPos.y(), real_scale.x(), real_scale.y(), blink * texSize.x(), 0, texSize.x(), texSize.y(), real, Color::white, 0.0f, Vec2f::Ones(), Vec2f(real_scale.x() * 0.5f, 0)); } }
void Enemy::DrawDeadEffect() { if (nowHp == 0 && deadEffectTime <= 25) { int animetionIndex = (deadEffectTime / 6) % 5; drawTextureBox(position.x() -30, position.y() -30, 60, 60, animetionIndex * 86, 0, 80, 86, deadEffectImage, Color(1,1,1,0.45f)); } }
void Player::draw(){ if (direction == DIRECTION::LEFT){ drawTextureBox( 0 + player.size.x() / 2 + dead_x, 0, player.size.x(), player.size.y(), 0 + cut_x, 0 + cut_y, 256, 256, player_texture, color256(255,255,255,255-dead_animation_count-clear_animation_count), 0, Vec2f(-1, 1), Vec2f(player.size.x() / 2, 0) ); } if (direction == DIRECTION::RIGHT){ drawTextureBox( 0 + player.size.x() / 2 + dead_x, 0, player.size.x(), player.size.y(), 0 + cut_x, 0 + cut_y, 256, 256, player_texture, color256(255, 255, 255, 255 - dead_animation_count - clear_animation_count), 0, Vec2f(1, 1), Vec2f(player.size.x() / 2, 0) ); } }
void CharacterBase::drawPattern(const Vec2f & pos_, const int & index_, const Texture & tex_) { Pattern& p = patterns[index_]; drawTextureBox(pos_.x() + p.offset.x(), pos_.y() + p.offset.y(), size.x(), size.y(), p.start.x(), p.start.y(), p.size.x(), p.size.y(), tex_, Color::white, 0, Vec2f(chara_direction, 1.0f), size / 2); patternsSizeChangePoint(p.size.x()); }