SDXFrameWork 0.13 SDXFrameWork

- Main Page
- Related Pages
- Classes

All Classes Namespaces Functions Variables Enumerations Enumerator Pages
ISprite.h
1 //Copyright © 2014 SDXFramework
2 //[License]GNU Affero General Public License, version 3
3 //[Contact]http://sourceforge.jp/projects/dxframework/
4 #pragma once
5 #include <Multimedia/Image.h>
6 #include <Framework/Camera.h>
7 #include <Multimedia/Screen.h>
8 #include <Multimedia/Input.h>
9 #include <Multimedia/Font.h>
10 #include <Framework/BmpFrame.h>
11 #include <memory>
12
13 namespace SDX
14 {
17 class ISprite
18 {
19 friend class IModel;
20 protected:
21 double zoomX = 1;
22 double zoomY = 1;
23 double angle = 0;
24
25 public:
26 bool isTurn = false;
27 Color color = { 255, 255, 255, 255 };
28 Point gap = {0,0};
29 Point axis = {0,0};
30
31 virtual ~ISprite() = default;
32
34 virtual void Draw(const IShape &図形) const = 0;
35
37 void SetZoom(double X拡大率, double Y拡大率)
38 {
39 zoomX = X拡大率;
40 zoomY = Y拡大率;
41 }
42
44 void MultiZoom(double 倍率)
45 {
46 MultiZoom(倍率, 倍率);
47 }
48
50 void MultiZoom(double X倍率, double Y倍率)
51 {
52 zoomX *= X倍率;
53 zoomY *= Y倍率;
54
55 gap.x *= X倍率;
56 gap.y *= Y倍率;
57 }
58
60 double GetZoomX()
61 {
62 return this->zoomX;
63 }
64
66 double GetZoomY()
67 {
68 return this->zoomY;
69 }
70
72 double GetAngle()
73 {
74 return this->angle;
75 }
76
78 void SetAngle(double 角度)
79 {
80 this->angle = 角度;
81 }
82
84 void Rotate(double 回転する角度)
85 {
86 this->angle += 回転する角度;
87 }
88
90 virtual void Update(){};
91 };
92 }
SDX::ISprite::angle
double angle
角度
Definition: ISprite.h:23
SDX::Point::y
double y
座標
Definition: Point.h:26
SDX::ISprite::axis
Point axis
回転軸のずれ
Definition: ISprite.h:29
SDX::ISprite::Rotate
void Rotate(double 回転する角度)
回転させる.
Definition: ISprite.h:84
SDX::Point
点を表す図形クラス.
Definition: Point.h:22
SDX::ISprite::Update
virtual void Update()
Anime等の更新処理.
Definition: ISprite.h:90
SDX::IShape
衝突判定可能な図形の抽象クラス.
Definition: IShape.h:21
SDX::ISprite::SetAngle
void SetAngle(double 角度)
表示角度を設定.
Definition: ISprite.h:78
SDX::ISprite::zoomY
double zoomY
描画倍率
Definition: ISprite.h:22
SDX::ISprite::color
Color color
描画色
Definition: ISprite.h:27
SDX::ISprite
2Dモデルに貼り付けるスプライトを表す抽象クラス.
Definition: ISprite.h:17
SDX::Color
色を表すクラス.
Definition: Color.h:11
SDX::ISprite::Draw
virtual void Draw(const IShape &図形) const =0
ISpriteを描画する.
SDX::ISprite::MultiZoom
void MultiZoom(double X倍率, double Y倍率)
縦横別で拡大率を掛け算する.
Definition: ISprite.h:50
SDX::ISprite::GetAngle
double GetAngle()
表示角度を取得.
Definition: ISprite.h:72
SDX::ISprite::gap
Point gap
Shape中心とSpriteとの位置差
Definition: ISprite.h:28
SDX::ISprite::SetZoom
void SetZoom(double X拡大率, double Y拡大率)
表示倍率を設定.
Definition: ISprite.h:37
SDX::Point::x
double x
座標
Definition: Point.h:25
SDX::IModel
ShapeとSpriteをまとめて、2Dモデルを表すクラス.
Definition: IModel.h:13
SDX::ISprite::MultiZoom
void MultiZoom(double 倍率)
拡大率を掛け算する.
Definition: ISprite.h:44
SDX::ISprite::GetZoomY
double GetZoomY()
縦方向の表示倍率を取得.
Definition: ISprite.h:66
SDX::ISprite::isTurn
bool isTurn
反転フラグ
Definition: ISprite.h:26
SDX::ISprite::GetZoomX
double GetZoomX()
横方向の表示倍率を取得.
Definition: ISprite.h:60
SDX::ISprite::zoomX
double zoomX
描画倍率
Definition: ISprite.h:21