1 define <export> {
2 //Sprite2D
3 SPRITE2D_SYSTEMRAM = 1
4 SPRITE2D_ALPHA = 2
5 SPRITE2D_TEXTURE = 4
6 SPRITE2D_ALPHABLENDING = 8
7 }
8
9 type Sprite2D <inherit = GAPI_Object>{
10 int iTransparentColor
11 }
12
13 global {
14 int GAPI_Sprite2DTransparent = 0x000000
15 }
16
17 operator Sprite2D = (Sprite2D left, int right){ //создание объекта Sprite2D по хэнделу спрайта
18 left.id = right
19 return left
20 }
21
22 method int Sprite2D.Catch(int Mem){
23 this.id = Sprite2D_Catch(Mem,0)
24 return this.id
25 }
26 method int Sprite2D.Catch(int Mem Mode){
27 this.id = Sprite2D_Catch(Mem,Mode)
28 return this.id
29 }
30 method int Sprite2D.UnClip(){
31 return Sprite2D_Clip(this.id,-1,-1,-1,-1)
32 }
33 method int Sprite2D.Clip(int x){
34 return Sprite2D_Clip(this.id,x,-1,-1,-1)
35 }
36 method int Sprite2D.Clip(int x y){
37 return Sprite2D_Clip(this.id,x,y,-1,-1)
38 }
39 method int Sprite2D.Clip(int x y width){
40 return Sprite2D_Clip(this.id,x,y,width,-1)
41 }
42 method int Sprite2D.Clip(int x y width height){
43 return Sprite2D_Clip(this.id,x,y,width,height)
44 }
45 method int Sprite2D.Dublicate(){
46 return Sprite2D_Copy(this.id,0)
47 }
48 method int Sprite2D.Dublicate(int Mode){
49 return Sprite2D_Copy(this.id,Mode)
50 }
51 method int Sprite2D.Create(int width height){
52 this.id = Sprite2D_Create(width,height,0)
53 return this.id
54 }
55 method int Sprite2D.Create(int width height Mode){
56 this.id = Sprite2D_Create(width,height,Mode)
57 return this.id
58 }
59 method Sprite2D.Show(int x y){
60 Sprite2D_Display(this.id,x,y)
61 }
62 method Sprite2D.ShowAsAlpha(int x y){
63 Sprite2D_DisplayAlpha(this.id,x,y)
64 }
65 method Sprite2D.ShowShadow(int x y){
66 Sprite2D_DisplayShadow(this.id,x,y)
67 }
68 method Sprite2D.ShowSolid(int x y RGB){
69 Sprite2D_DisplaySolid(this.id,x,y,RGB)
70 }
71 method Sprite2D.ShowSolid(int x y R G B){
72 Sprite2D_DisplaySolid(this.id,x,y,(R<<16) + (G<<8) + B)
73 }
74 method Sprite2D.ShowAlphaBlend(int x y Intensity){
75 Sprite2D_DisplayTranslucent(this.id,x,y,Intensity)
76 }
77 method Sprite2D.DisplayAsTransparent(int x y){
78 Sprite2D_DisplayTransparent(this.id,x,y)
79 }
80 method Sprite2D.Free(){
81 Sprite2D_Free(this.id)
82 this.iTransparentColor = GAPI_Sprite2DTransparent
83 }
84 property int Sprite2D.Exist{
85 return Sprite2D_Exist(this.id)
86 }
87 method int Sprite2D.Load(str FileName){
88 this.id = Sprite2D_Load(FileName.ptr(),0)
89 return this.id
90 }
91 method int Sprite2D.Load(str FileName,int Mode){
92 this.id = Sprite2D_Load(FileName.ptr(),Mode)
93 return this.id
94 }
95 func int Sprite2DCollision(Sprite2D Sprite1, int x1 y1, Sprite2D Sprite2, int x2 y2){
96 return Sprite2D_Collision(Sprite1.id,x1,y1,Sprite2.id,x2,y2)
97 }
98 func int Sprite2DPixelCollision(Sprite2D Sprite1, int x1 y1, Sprite2D Sprite2, int x2 y2){
99 return Sprite2D_PixelCollision(Sprite1.id, x1, y1, Sprite2.id, x2, y2)
100 }
101 property int Sprite2D.Depth{
102 return Sprite2D_GetDepth(this.id)
103 }
104 property int Sprite2D.Height{
105 return Sprite2D_GetHeight(this.id)
106 }
107 property int Sprite2D.Width{
108 return Sprite2D_GetWidth(this.id)
109 }
110 property int Sprite2D.Handle{
111 return Sprite2D_GetHandle(this.id)
112 }
113 func Sprite2DTransparenColor(int RGB){
114 Sprite2D_SetTransparentColor(-1,RGB)
115 }
116 func Sprite2DTransparenColor(int R G B){
117 Sprite2D_SetTransparentColor(-1,(R<<16) + (G<<8) + B)
118 }
119 method Sprite2D.setTransparentColor(int RGB){
120 this.iTransparentColor = RGB
121 Sprite2D_SetTransparentColor(this.id,RGB)
122 }
123 method Sprite2D.setTransparentColor(int R G B){
124 int rgb = (R<<16) + (G<<8) + B
125 this.iTransparentColor = rgb
126 Sprite2D_SetTransparentColor(this.id,rgb)
127 }
128 property Sprite2D.TransparentColor(int RGB){
129 this.iTransparentColor = RGB
130 Sprite2D_SetTransparentColor(this.id,RGB)
131 }
132 property int Sprite2D.TransparentColor{
133 return this.TransparentColor
134 }
135 method Sprite2D.AsBuffer{
136 Sprite2D_UseBuffer(this.id)
137 }
138 property int Sprite2D.Canvas{
139 return Sprite2D_GetOutput(this.id)
140 }
141
142 method TScreen.AlphaIntensity(int RGB){
143 Sprite2D_ChangeAlphaIntensity(RGB >> 16,RGB >> 8 & 0xFF,RGB & 0xFF)
144 }
145 method TScreen.setAlphaIntensity(int RGB){
146 Sprite2D_ChangeAlphaIntensity(RGB >> 16,RGB >> 8 & 0xFF,RGB & 0xFF)
147 }
148 method TScreen.setAlphaIntensity(int R G B){
149 Sprite2D_ChangeAlphaIntensity(R,G,B)
150 }
151 method int TScreen.Grab(int x y width height){
152 return Sprite2D_Grab(x,y,width,height,0)
153 }
154 method int TScreen.Grab(int x y width height Mode){
155 return Sprite2D_Grab(x,y,width,height,Mode)
156 }
157
158 method TScreen.AsSprite2D(Sprite2D Sprite){
159 Sprite2D_UseBuffer(Sprite.id)
160 }
161 method TScreen.AsNormal(){
162 Sprite2D_UseBuffer(-1)
163 }
164
165