DXフレームワーク　リファレンス・マニュアル 0.01 DXフレームワークのリファレンスです。詳細は公式wiki

- メインページ
- 関連ページ
- クラス
- ファイル

- ファイル一覧

Sprite.h
1 #pragma once
2 #include "Image.h"
3 #include "Figure.h"
4 #include "Camera.h"
5 #include "Screen.h"
6 #include "Input.h"
7 #include "Font.h"
8 #include "BmpFrame.h"
9 #include <memory>
10
11 namespace DXFW
12 {
28 class Sprite
29 {
30 friend class Model;
31
32 protected:
33 double zoomX;
34 double zoomY;
35
36 double gapX;//中心モデルとの位置差
37 double gapY;
38
39 double axisX;//回転軸
40 double axisY;
41
42 int alpha;
43 double angle;
44 public:
45 bool isTurn;
46 bool isVisible;
47 bool isActive;
48 bool isAllway;
49
50 Sprite():
51 zoomX(1),
52 zoomY(1),
53 gapX(0),
54 gapY(0),
55 axisX(0),
56 axisY(0),
57 alpha(255),
58 angle(0),
59 isTurn(false),
60 isActive(false),
61 isVisible(true),
62 isAllway(true)
63 {}
64
65 Sprite(const Sprite* prototype):
66 zoomX(prototype->zoomX),
67 zoomY(prototype->zoomY),
68 gapX(prototype->gapX),
69 gapY(prototype->gapY),
70 axisX(prototype->axisX),
71 axisY(prototype->axisY),
72 alpha(prototype->alpha),
73 angle(prototype->angle),
74 isTurn(prototype->isTurn),
75 isActive(prototype->isTurn),
76 isVisible(prototype->isTurn),
77 isAllway(prototype->isTurn)
78 {}
79
80 virtual ~Sprite(){};
81
82 virtual void Draw( double x , double y , bool isCamera) = 0;
83
85 void MoveGap(double x , double y)
86 {
87 gapX += x;
88 gapY += y;
89 }
90
92 void SetGap(double x , double y )
93 {
94 gapX = x;
95 gapY = y;
96 }
97
99 void SetZoom(double rateX , double rateY)
100 {
101 zoomX = rateX;
102 zoomY = rateY;
103 }
104
106 void MultiZoom(double rate )
107 {
108 zoomX *= rate;
109 zoomY *= rate;
110 }
111
113 void MultiZoom(double rateX , double rateY)
114 {
115 zoomX *= rateX;
116 zoomY *= rateY;
117 }
118
120 double GetZoomX()
121 {
122 return this->zoomX;
123 }
124
126 double GetZoomY()
127 {
128 return this->zoomY;
129 }
130
132 void SetTurn( bool isTurn )
133 {
134 this->isTurn = isTurn;
135 }
136
138 bool GetTurn()
139 {
140 return this->isTurn;
141 }
142
144 double GetAngle()
145 {
146 return this->angle;
147 }
148
150 void SetAngle( double angle )
151 {
152 this->angle = angle;
153 }
154
156 void Rotate( double angle )
157 {
158 this->angle += angle;
159 }
160
162 int GetAlpha()
163 {
164 return this->alpha;
165 }
166
168 void SetAlpha( int alpha)
169 {
170 this->alpha = alpha;
171 }
172
174 double GetX( double x , Camera *camera = nullptr )
175 {
176 if( camera ) return camera->TranX( x );
177 return x;
178 }
179
181 double GetY( double y , Camera *camera = nullptr )
182 {
183 if( camera ) return camera->TranY( y );
184 return y;
185 }
186
188 virtual void AnimeUpdate(){};
189 };
190
191 }
DXFW::Sprite::SetAlpha
void SetAlpha(int alpha)
説明
Definition: Sprite.h:168
DXFW::Sprite::GetX
double GetX(double x, Camera *camera=nullptr)
説明
Definition: Sprite.h:174
DXFW::Sprite::Rotate
void Rotate(double angle)
説明
Definition: Sprite.h:156
DXFW::Model
クラス説明
Definition: Model.h:25
DXFW::Sprite::GetY
double GetY(double y, Camera *camera=nullptr)
説明
Definition: Sprite.h:181
DXFW::Sprite::MoveGap
void MoveGap(double x, double y)
説明
Definition: Sprite.h:85
DXFW::Sprite::SetZoom
void SetZoom(double rateX, double rateY)
説明
Definition: Sprite.h:99
DXFW::Sprite::SetGap
void SetGap(double x, double y)
説明
Definition: Sprite.h:92
DXFW::Sprite::MultiZoom
void MultiZoom(double rateX, double rateY)
説明
Definition: Sprite.h:113
DXFW::Camera
2D用のカメラクラス
Definition: Camera.h:27
DXFW::Sprite::SetTurn
void SetTurn(bool isTurn)
説明
Definition: Sprite.h:132
DXFW::Sprite
クラス説明
Definition: Sprite.h:28
DXFW::Sprite::GetAlpha
int GetAlpha()
説明
Definition: Sprite.h:162
DXFW::Sprite::GetZoomY
double GetZoomY()
説明
Definition: Sprite.h:126
DXFW::Sprite::MultiZoom
void MultiZoom(double rate)
説明
Definition: Sprite.h:106
DXFW::Sprite::GetTurn
bool GetTurn()
説明
Definition: Sprite.h:138
DXFW::Sprite::GetAngle
double GetAngle()
説明
Definition: Sprite.h:144
DXFW::Sprite::GetZoomX
double GetZoomX()
説明
Definition: Sprite.h:120
DXFW::Sprite::SetAngle
void SetAngle(double angle)
説明
Definition: Sprite.h:150
DXFW::Sprite::AnimeUpdate
virtual void AnimeUpdate()
説明
Definition: Sprite.h:188