forked from sears2424/Source-PlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage.h
80 lines (69 loc) · 2.27 KB
/
Image.h
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
68
69
70
71
72
73
74
75
76
77
78
79
80
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef IMAGE_H
#define IMAGE_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui/VGUI.h>
#include <Color.h>
#include <vgui/IImage.h>
namespace vgui
{
class Panel;
//-----------------------------------------------------------------------------
// Purpose: Basic image control
//-----------------------------------------------------------------------------
class Image : public IImage
{
public:
Image();
virtual ~Image();
// Set the position of the image
virtual void SetPos( int x, int y );
// Get the position of the image
virtual void GetPos( int &x, int &y );
// Get the size of the image
virtual void GetSize( int &wide, int &tall );
virtual void GetContentSize( int &wide, int &tall );
// Set the draw color
virtual void SetColor( Color color );
// set the background color
virtual void SetBkColor( Color color ) { DrawSetColor( color ); }
// Get the draw color
virtual Color GetColor();
virtual bool Evict();
virtual int GetNumFrames();
virtual void SetFrame( int nFrame );
virtual HTexture GetID();
virtual void SetRotation( int iRotation ) { return; };
protected:
virtual void SetSize(int wide, int tall);
virtual void DrawSetColor(Color color);
virtual void DrawSetColor(int r, int g, int b, int a);
virtual void DrawFilledRect(int x0, int y0, int x1, int y1);
virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1);
virtual void DrawLine(int x0,int y0,int x1,int y1);
virtual void DrawPolyLine(int *px, int *py, int numPoints);
virtual void DrawSetTextFont(HFont font);
virtual void DrawSetTextColor(Color color);
virtual void DrawSetTextColor(int r, int g, int b, int a);
virtual void DrawSetTextPos(int x,int y);
virtual void DrawPrintText(const wchar_t *str, int strlen);
virtual void DrawPrintText(int x, int y, const wchar_t *str, int strlen);
virtual void DrawPrintChar(wchar_t ch);
virtual void DrawPrintChar(int x, int y, wchar_t ch);
virtual void DrawSetTexture(int id);
virtual void DrawTexturedRect(int x0, int y0, int x1, int y1);
virtual void Paint() = 0;
private:
int _pos[2];
int _size[2];
Color _color;
};
} // namespace vgui
#endif // IMAGE_H