211 begin |
211 begin |
212 {$IFDEF USE_TOUCH_INTERFACE} |
212 {$IFDEF USE_TOUCH_INTERFACE} |
213 //positioning of the buttons |
213 //positioning of the buttons |
214 buttonScale:= 1.5/cDefaultZoomLevel; |
214 buttonScale:= 1.5/cDefaultZoomLevel; |
215 |
215 |
216 with firebutton do |
216 |
|
217 with JumpWidget do |
217 begin |
218 begin |
218 show:= true; |
219 show:= true; |
219 sprite:= sprFireButton; |
220 sprite:= sprJumpWidget; |
220 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
221 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
221 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
222 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
222 frame.x:= (cScreenWidth shr 1) - frame.w; |
223 frame.x:= (cScreenWidth shr 1) - Round(frame.w * 1.2); |
223 frame.y:= cScreenHeight - frame.h; |
224 frame.y:= cScreenHeight - frame.h * 2; |
224 active.x:= frame.x; |
225 active.x:= frame.x; |
225 active.y:= frame.y; |
226 active.y:= frame.y; |
226 active.w:= frame.w; |
227 active.w:= frame.w; |
227 active.h:= frame.h; |
228 active.h:= frame.h; |
228 end; |
229 end; |
229 |
230 |
230 with backjump do |
231 with AMWidget do |
231 begin |
232 begin |
232 show:= true; |
233 show:= true; |
233 sprite:= sprbackjump; |
234 sprite:= sprAMWidget; |
234 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
235 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
235 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
236 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
236 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
237 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
237 frame.y:= cScreenHeight - Round(frame.h * 1.2); |
238 frame.y:= cScreenHeight - Round(frame.h * 1.2); |
238 active.x:= frame.x; |
|
239 active.y:= frame.y; |
|
240 active.w:= frame.w; |
|
241 active.h:= frame.h; |
|
242 end; |
|
243 |
|
244 with forwardjump do |
|
245 begin |
|
246 show:= true; |
|
247 sprite:= sprforwardjump; |
|
248 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
|
249 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
|
250 frame.x:= (cScreenWidth shr 1) - Round(frame.w * 1.2); |
|
251 frame.y:= cScreenHeight - frame.h * 2; |
|
252 active.x:= frame.x; |
239 active.x:= frame.x; |
253 active.y:= frame.y; |
240 active.y:= frame.y; |
254 active.w:= frame.w; |
241 active.w:= frame.w; |
255 active.h:= frame.h; |
242 active.h:= frame.h; |
256 end; |
243 end; |
281 active.y:= frame.y; |
268 active.y:= frame.y; |
282 active.w:= frame.w; |
269 active.w:= frame.w; |
283 active.h:= frame.h; |
270 active.h:= frame.h; |
284 end; |
271 end; |
285 |
272 |
|
273 with firebutton do |
|
274 begin |
|
275 show:= true; |
|
276 sprite:= sprFireButton; |
|
277 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
|
278 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
|
279 frame.x:= arrowRight.frame.x + arrowRight.frame.w; |
|
280 frame.y:= arrowRight.frame.y + (arrowRight.frame.w shr 1) - (frame.w shr 1); |
|
281 active.x:= frame.x; |
|
282 active.y:= frame.y; |
|
283 active.w:= frame.w; |
|
284 active.h:= frame.h; |
|
285 end; |
|
286 |
286 with arrowUp do |
287 with arrowUp do |
287 begin |
288 begin |
288 show:= false; |
289 show:= false; |
289 sprite:= sprArrowUp; |
290 sprite:= sprArrowUp; |
290 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
291 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
291 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
292 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
292 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
293 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
293 frame.y:= backjump.frame.y - Round(frame.h * 2.25); |
294 frame.y:= jumpWidget.frame.y - Round(frame.h * 2.25); |
294 active.x:= frame.x; |
295 active.x:= frame.x; |
295 active.y:= frame.y; |
296 active.y:= frame.y; |
296 active.w:= frame.w; |
297 active.w:= frame.w; |
297 active.h:= frame.h; |
298 active.h:= frame.h; |
298 with moveAnim do |
299 with moveAnim do |
309 show:= false; |
310 show:= false; |
310 sprite:= sprArrowDown; |
311 sprite:= sprArrowDown; |
311 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
312 frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale); |
312 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
313 frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale); |
313 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
314 frame.x:= (cScreenWidth shr 1) - frame.w * 2; |
314 frame.y:= backjump.frame.y - Round(frame.h * 2.25); |
315 frame.y:= jumpWidget.frame.y - Round(frame.h * 2.25); |
315 active.x:= frame.x; |
316 active.x:= frame.x; |
316 active.y:= frame.y; |
317 active.y:= frame.y; |
317 active.w:= frame.w; |
318 active.w:= frame.w; |
318 active.h:= frame.h; |
319 active.h:= frame.h; |
319 with moveAnim do |
320 with moveAnim do |
1210 DrawScreenWidget(@arrowRight); |
1211 DrawScreenWidget(@arrowRight); |
1211 DrawScreenWidget(@arrowUp); |
1212 DrawScreenWidget(@arrowUp); |
1212 DrawScreenWidget(@arrowDown); |
1213 DrawScreenWidget(@arrowDown); |
1213 |
1214 |
1214 DrawScreenWidget(@fireButton); |
1215 DrawScreenWidget(@fireButton); |
1215 DrawScreenWidget(@backjump); |
1216 DrawScreenWidget(@jumpWidget); |
1216 DrawScreenWidget(@forwardjump); |
1217 DrawScreenWidget(@AMWidget); |
1217 DrawScreenWidget(@pauseButton); |
1218 DrawScreenWidget(@pauseButton); |
1218 {$ENDIF} |
1219 {$ENDIF} |
1219 |
1220 |
1220 // Teams Healths |
1221 // Teams Healths |
1221 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then // take up less screen on small displays |
1222 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then // take up less screen on small displays |