-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGameObject2D.h
More file actions
67 lines (67 loc) · 1.82 KB
/
Copy pathGameObject2D.h
File metadata and controls
67 lines (67 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <windows.h>
#include <d2d1.h>
#include <dshow.h>
#include "TimeVariantObject.h"
#include "DoubleThreadLock.h"
#include "D2D1DrawFactory.h"
#pragma comment (lib,"Dxguid.lib")
#pragma comment (lib, "d2d1")
#include <vector>
using namespace D2D1;
namespace AwpSoftGameModule
{
class GameObject2D :public TimeVariantObject
{
public:
bool Enable, Visible, WillDestory, ExistLifeTime;
float PosCenterX, PosCenterY, PicCenterX, PicCenterY, RotationDEG, SecondaryAlpha, WScale, HScale;
long long LifeTime;
GameObject2D();
virtual ~GameObject2D();
virtual bool giveTime(int timeGived);
virtual void reset();
};
class GameObjectD2D1 :public GameObject2D
{
protected:
ID2D1Bitmap* Image;//±ØÐëÓöÔÓ¦µÄRenderTarget»æÖÆ
public:
GameObjectD2D1();
virtual ~GameObjectD2D1();
void setImage(ID2D1Bitmap* img);
virtual DrawParametersD2D1 getDrawParameters();
virtual void draw(D2D1DrawFactory *drawFactory);
virtual void reset();
};
class MovingGameObjectD2D1 :public GameObjectD2D1
{
public:
float VelocityX, VelocityY, AccelerX, AccelerY, OmegaDEG, EpsilonDEG;
long long MoveTimeRemain;
MovingGameObjectD2D1();
virtual ~MovingGameObjectD2D1();
virtual bool giveTime(int timeGived);
virtual void reset();
};
class TextBoxD2D1 :public MovingGameObjectD2D1
{
protected:
std::vector<wchar_t> Text;
int StrLength;
public:
float TextLeftX, TextRightX, TextTopY, TypedLength, TypeSpeed;
bool BoundAlpha, BoundTrasnform, UseRelativePos, TypingMode;
IDWriteTextFormat *TextFormat;
D2D_COLOR_F ColorF;
TextBoxD2D1();
virtual ~TextBoxD2D1();
void skipTyping();
bool isTypingComplete();
void setText(wchar_t* wstr);
virtual void reset();
virtual bool giveTime(int timeGived);
virtual TextParametersD2D1 getTextParameters();
virtual void draw(D2D1DrawFactory *drawFactory);
};
};