SDXFrameWork  0.07
SDXFrameWork
 全て クラス ネームスペース 関数 変数 列挙型 列挙型の値 ページ
BmpFrame.h
1 #pragma once//☀SDXFramework
2 #include <Multimedia/Image.h>
3 #include <Multimedia/Font.h>
4 #include <Framework/BmpFont.h>
5 #include <Framework/Anime.h>
6 
7 namespace SDX
8 {
9 
12 class IFrame
13 {
14 public:
15  virtual void Draw(int X座標, int Y座標, int 幅, int 高さ) const = 0;
16 };
17 
20 class BmpFrame : public IFrame
21 {
22 private:
23  bool isMake;
24  ImagePack *frame;
25 public:
28  bool Make( ImagePack *フレーム画像 )
29  {
30  if( フレーム画像->GetSize() != 9 ) return false;
31 
32  this->frame = フレーム画像;
33  this->isMake = true;
34 
35  return true;
36  }
37 
40  void Draw( int X座標, int Y座標, int 幅, int 高さ) const
41  {
42  const int fWidth = frame->GetWidth();
43  const int fHeight = frame->GetHeight();
44 
45  const int xA = X座標 + fWidth;
46  const int xB = X座標 - fWidth + 幅;
47  const int yA = Y座標 + fHeight;
48  const int yB = Y座標 - fHeight + 高さ;
49 
50  //内部スキンを描画
51  frame[0][4]->DrawExtend(X座標 + fWidth, Y座標 + fHeight, X座標 + 幅 - fWidth, Y座標 + 高さ - fHeight);
52 
53  //まず外枠を描画
54  frame[0][3]->DrawExtend(X座標, yA, xA, yB);
55  frame[0][5]->DrawExtend(xB, yA, xB + fWidth, yB);
56 
57  frame[0][1]->DrawExtend(xA, Y座標, xB, yA);
58  frame[0][7]->DrawExtend(xA, yB, xB, yB + fHeight);
59 
60  //四隅を描画
61  frame[0][0]->Draw(X座標, Y座標);
62  frame[0][2]->Draw(X座標 + 幅 - fWidth, Y座標);
63  frame[0][6]->Draw(X座標, Y座標 + 高さ - fHeight);
64  frame[0][8]->Draw(X座標 + 幅 - fWidth, Y座標 + 高さ - fHeight);
65  }
66 };
67 }
void Draw(int X座標, int Y座標, int 幅, int 高さ) const
矩形のフレームを描画.
Definition: BmpFrame.h:40
int GetWidth() const
最大幅を取得.
Definition: ImagePack.h:107
bool Make(ImagePack *フレーム画像)
フレームを作成する.
Definition: BmpFrame.h:28
描画用枠を表すクラス.
Definition: BmpFrame.h:20
int GetSize() const
要素数を取得.
Definition: ImagePack.h:101
int GetHeight() const
最大高さを取得.
Definition: ImagePack.h:113
複数のImageをまとめるクラス.
Definition: ImagePack.h:9
描画用枠のインターフェース.
Definition: BmpFrame.h:12