217 firebutton.y:= -Round(spritesData[sprFireButton].Texture^.h* buttonScale) + cScreenHeight; |
218 firebutton.y:= -Round(spritesData[sprFireButton].Texture^.h* buttonScale) + cScreenHeight; |
218 firebutton.width:= Round(spritesData[sprFireButton].Texture^.w * buttonScale); |
219 firebutton.width:= Round(spritesData[sprFireButton].Texture^.w * buttonScale); |
219 firebutton.height:= Round(spritesData[sprFireButton].Texture^.h * buttonScale); |
220 firebutton.height:= Round(spritesData[sprFireButton].Texture^.h * buttonScale); |
220 firebutton.hOffset:= 0; |
221 firebutton.hOffset:= 0; |
221 firebutton.vOffset:= 0; |
222 firebutton.vOffset:= 0; |
|
223 firebutton.sprite:= sprFireButton; |
|
224 firebutton.show:= true; |
222 |
225 |
223 backjump.x:= (cScreenWidth shr 1) - Round(spritesData[sprbackjump].Texture^.h * 2 * buttonScale); |
226 backjump.x:= (cScreenWidth shr 1) - Round(spritesData[sprbackjump].Texture^.h * 2 * buttonScale); |
224 backjump.y:= -Round(spritesData[sprbackjump].Texture^.h * 1.2 * buttonScale) + cScreenHeight; |
227 backjump.y:= -Round(spritesData[sprbackjump].Texture^.h * 1.2 * buttonScale) + cScreenHeight; |
225 backjump.width:= Round(spritesData[sprbackjump].Texture^.w * buttonScale); |
228 backjump.width:= Round(spritesData[sprbackjump].Texture^.w * buttonScale); |
226 backjump.height:= Round(spritesData[sprbackjump].Texture^.h * buttonScale); |
229 backjump.height:= Round(spritesData[sprbackjump].Texture^.h * buttonScale); |
227 backjump.hOffset:= 0; |
230 backjump.hOffset:= 0; |
228 backjump.vOffset:= 0; |
231 backjump.vOffset:= 0; |
|
232 backjump.sprite:= sprbackjump; |
|
233 backjump.show:= true; |
229 |
234 |
230 forwardjump.x:= (cScreenWidth shr 1) - Round(spritesData[sprforwardjump].Texture^.h * 1.2 * buttonScale); |
235 forwardjump.x:= (cScreenWidth shr 1) - Round(spritesData[sprforwardjump].Texture^.h * 1.2 * buttonScale); |
231 forwardjump.y:= -Round(spritesData[sprforwardjump].Texture^.h * 2 * buttonScale) + cScreenHeight; |
236 forwardjump.y:= -Round(spritesData[sprforwardjump].Texture^.h * 2 * buttonScale) + cScreenHeight; |
232 forwardjump.width:= Round(spritesData[sprforwardjump].Texture^.w * buttonScale); |
237 forwardjump.width:= Round(spritesData[sprforwardjump].Texture^.w * buttonScale); |
233 forwardjump.height:= Round(spritesData[sprforwardjump].Texture^.h * buttonScale); |
238 forwardjump.height:= Round(spritesData[sprforwardjump].Texture^.h * buttonScale); |
234 forwardjump.hOffset:= 0; |
239 forwardjump.hOffset:= 0; |
235 forwardjump.vOffset:= 0; |
240 forwardjump.vOffset:= 0; |
236 |
241 forwardjump.sprite:= sprforwardjump; |
237 arrowLeft.x:= -(cScreenWidth shr 1); |
242 forwardjump.show:= true; |
238 arrowLeft.y:= -Round(spritesData[sprArrowLeft].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprArrowLeft].Texture^.h*buttonScale); |
243 |
239 arrowLeft.width:= Round(spritesData[sprArrowLeft].Texture^.h * buttonScale); |
244 with arrowLeft do |
240 arrowLeft.height:= Round(spritesData[sprArrowLeft].Texture^.h * buttonScale); |
245 begin |
241 arrowLeft.hOffset:= 0; |
246 show:= true; |
242 arrowLeft.vOffset:= 0; |
247 sprite:= sprArrowLeft; |
243 |
248 x:= -(cScreenWidth shr 1); |
244 arrowRight.x:= -(cScreenWidth shr 1)+ Round(spritesData[sprArrowUp].Texture^.h * buttonScale *2); |
249 y:= -Round(spritesData[sprite].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprite].Texture^.h*buttonScale); |
245 arrowRight.y:= -Round(spritesData[sprArrowRight].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprArrowRight].Texture^.h*buttonScale); |
250 width:= Round(spritesData[sprite].Texture^.h * buttonScale); |
246 arrowRight.width:= Round(spritesData[sprArrowRight].Texture^.w * buttonScale); |
251 height:= Round(spritesData[sprite].Texture^.h * buttonScale); |
247 arrowRight.height:= Round(spritesData[sprArrowRight].Texture^.h * buttonScale); |
252 hOffset:= 0; |
248 arrowRight.hOffset:= 0; |
253 vOffset:= 0; |
249 arrowRight.vOffset:= 0; |
254 end; |
250 |
255 with arrowRight do |
251 arrowUp.x:= -(cScreenWidth shr 1) + Round(spritesData[sprArrowUp].Texture^.h * buttonScale); |
256 begin |
252 arrowUp.y:= -Round(spritesData[sprArrowUp].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprArrowUp].Texture^.h*buttonScale*2); |
257 show:= true; |
253 arrowUp.width:= Round(spritesData[sprArrowUp].Texture^.w * buttonScale); |
258 sprite:= sprArrowRight; |
254 arrowUp.height:= Round(spritesData[sprArrowUp].Texture^.h * buttonScale); |
259 x:= -(cScreenWidth shr 1)+ Round(spritesData[sprite].Texture^.h * buttonScale); |
255 arrowUp.hOffset:= 0; |
260 y:= -Round(spritesData[sprite].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprite].Texture^.h*buttonScale); |
256 arrowUp.vOffset:= 0; |
261 width:= Round(spritesData[sprite].Texture^.w * buttonScale); |
257 |
262 height:= Round(spritesData[sprite].Texture^.h * buttonScale); |
258 arrowDown.x:= -(cScreenWidth shr 1) + Round(spritesData[sprArrowUp].Texture^.h * buttonScale); |
263 hOffset:= 0; |
259 arrowDown.y:= -Round(spritesData[sprArrowDown].Texture^.h*buttonscale) + cScreenHeight; |
264 vOffset:= 0; |
260 arrowDown.width:= Round(spritesData[sprArrowDown].Texture^.w * buttonScale); |
265 with moveAnim do |
261 arrowDown.height:= Round(spritesData[sprArrowDown].Texture^.h * buttonScale); |
266 begin |
262 arrowDown.hOffset:= 0; |
267 targetToX:= arrowRight.x; |
263 arrowDown.vOffset:= 0; |
268 targetToY:= arrowRight.y; |
|
269 targetFromX:= arrowRight.x + Round(spritesData[sprArrowUp].Texture^.h * buttonScale); |
|
270 targetFromY:= arrowRight.y; |
|
271 end; |
|
272 end; |
|
273 |
|
274 with arrowUp do |
|
275 begin |
|
276 show:= false; |
|
277 sprite:= sprArrowUp; |
|
278 x:= -(cScreenWidth shr 1) + Round(spritesData[sprite].Texture^.h * buttonScale); |
|
279 y:= arrowRight.y; |
|
280 width:= Round(spritesData[sprite].Texture^.w * buttonScale); |
|
281 height:= Round(spritesData[sprite].Texture^.h * buttonScale); |
|
282 hOffset:= 0; |
|
283 vOffset:= 0; |
|
284 with moveAnim do |
|
285 begin |
|
286 targetToX:= arrowUp.x; |
|
287 targetToY:= arrowUp.y; |
|
288 targetFromX:= arrowUp.x; |
|
289 targetFromY:= -Round(spritesData[sprite].Texture^.h*buttonScale) + cScreenHeight - Round(spritesData[sprite].Texture^.h*buttonScale*2); |
|
290 end; |
|
291 end; |
|
292 |
|
293 with arrowDown do |
|
294 begin |
|
295 show:= false; |
|
296 sprite:= sprArrowDown; |
|
297 x:= -(cScreenWidth shr 1) + Round(spritesData[sprArrowUp].Texture^.h * buttonScale); |
|
298 y:= arrowRight.y; |
|
299 width:= Round(spritesData[sprArrowDown].Texture^.w * buttonScale); |
|
300 height:= Round(spritesData[sprArrowDown].Texture^.h * buttonScale); |
|
301 hOffset:= 0; |
|
302 vOffset:= 0; |
|
303 with moveAnim do |
|
304 begin |
|
305 targetToX:= arrowDown.x; |
|
306 targetToY:= arrowDown.y; |
|
307 targetFromX:= arrowDown.x; |
|
308 targetFromY:= -Round(spritesData[sprArrowDown].Texture^.h*buttonscale) + cScreenHeight; |
|
309 end; |
|
310 end; |
264 |
311 |
265 pauseButton.x:= cScreenWidth div 2 - Round(spritesData[sprPauseButton].Texture^.w * buttonscale); |
312 pauseButton.x:= cScreenWidth div 2 - Round(spritesData[sprPauseButton].Texture^.w * buttonscale); |
266 pauseButton.y:= 0; //-Round(spritesData[sprPauseButton].Texture^.h * buttonscale); |
313 pauseButton.y:= 0; //-Round(spritesData[sprPauseButton].Texture^.h * buttonscale); |
267 pauseButton.width:= Round(spritesData[sprPauseButton].Texture^.w * buttonScale);; |
314 pauseButton.width:= Round(spritesData[sprPauseButton].Texture^.w * buttonScale);; |
268 pauseButton.height:= Round(spritesData[sprPauseButton].Texture^.h * buttonScale);; |
315 pauseButton.height:= Round(spritesData[sprPauseButton].Texture^.h * buttonScale);; |
269 pauseButton.hOffset:= 0; |
316 pauseButton.hOffset:= 0; |
270 pauseButton.vOffset:= 0; |
317 pauseButton.vOffset:= 0; |
|
318 pauseButton.sprite:= sprPauseButton; |
|
319 pauseButton.show:= true; |
271 |
320 |
272 {$ENDIF} |
321 {$ENDIF} |
273 end; |
322 end; |
274 |
323 |
275 // for uStore texture resetting |
324 // for uStore texture resetting |
1117 // Captions |
1167 // Captions |
1118 DrawCaptions; |
1168 DrawCaptions; |
1119 |
1169 |
1120 {$IFDEF USE_TOUCH_INTERFACE} |
1170 {$IFDEF USE_TOUCH_INTERFACE} |
1121 // Draw buttons Related to the Touch interface |
1171 // Draw buttons Related to the Touch interface |
|
1172 DrawScreenWidget(@arrowLeft); |
|
1173 DrawScreenWidget(@arrowRight); |
|
1174 DrawScreenWidget(@arrowUp); |
|
1175 DrawScreenWidget(@arrowDown); |
|
1176 |
|
1177 DrawScreenWidget(@fireButton); |
|
1178 DrawScreenWidget(@backjump); |
|
1179 DrawScreenWidget(@forwardjump); |
|
1180 DrawScreenWidget(@pauseButton); |
|
1181 { |
1122 DrawTexture(arrowLeft.x, arrowLeft.y, spritesData[sprArrowLeft].Texture, buttonScale); |
1182 DrawTexture(arrowLeft.x, arrowLeft.y, spritesData[sprArrowLeft].Texture, buttonScale); |
1123 DrawTexture(arrowRight.x, arrowRight.y, spritesData[sprArrowRight].Texture, buttonScale); |
1183 DrawTexture(arrowRight.x, arrowRight.y, spritesData[sprArrowRight].Texture, buttonScale); |
1124 DrawTexture(arrowUp.x, arrowUp.y, spritesData[sprArrowUp].Texture, buttonScale); |
1184 DrawTexture(arrowUp.x, arrowUp.y, spritesData[sprArrowUp].Texture, buttonScale); |
1125 DrawTexture(arrowDown.x, arrowDown.y, spritesData[sprArrowDown].Texture, buttonScale); |
1185 DrawTexture(arrowDown.x, arrowDown.y, spritesData[sprArrowDown].Texture, buttonScale); |
1126 |
1186 |
1127 DrawTexture(fireButton.x, firebutton.y, spritesData[sprFireButton].Texture, buttonScale); |
1187 DrawTexture(fireButton.x, firebutton.y, spritesData[sprFireButton].Texture, buttonScale); |
1128 DrawTexture(backjump.x, backjump.y, spritesData[sprBackjump].Texture, buttonScale); |
1188 DrawTexture(backjump.x, backjump.y, spritesData[sprBackjump].Texture, buttonScale); |
1129 DrawTexture(forwardjump.x, forwardjump.y, spritesData[sprForwardjump].Texture, buttonScale); |
1189 DrawTexture(forwardjump.x, forwardjump.y, spritesData[sprForwardjump].Texture, buttonScale); |
1130 DrawTexture(pauseButton.x, pauseButton.y, spritesData[sprPauseButton].Texture, buttonScale); |
1190 DrawTexture(pauseButton.x, pauseButton.y, spritesData[sprPauseButton].Texture, buttonScale); |
1131 {$ENDIF} |
1191 }{$ENDIF} |
1132 |
1192 |
1133 // Teams Healths |
1193 // Teams Healths |
1134 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then // take up less screen on small displays |
1194 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then // take up less screen on small displays |
1135 begin |
1195 begin |
1136 SetScale(1.5); |
1196 SetScale(1.5); |