Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to tilt a layout in android?

i need to tilt a layout in android about 45 degree anticlockwise. i want to implement a game in android as stackopolis .is there any method to align tiles as in the game.I have the tile image,and now i use canvas to align this.but there i cannot get the click event and it is difficult to align tiles.is grid view is compatable.any new idea. i have these images with me.this is the main background

main background grid

tile

i want to align this tile in grid.and need click event as in the stackopolis

like image 874
KIRAN K J Avatar asked Jul 24 '11 08:07

KIRAN K J


3 Answers

For creating a game like this you really don't want to use layouts. You would create a tile engine using bitmap blitting or OpenGL.

like image 116
Will Kru Avatar answered Nov 09 '22 08:11

Will Kru


You can use the following methods, for rotation of view,

  • setRotation
  • setRotationX
  • setRotationY

Note: All the above are Since: API Level 11

like image 31
Labeeb Panampullan Avatar answered Nov 09 '22 07:11

Labeeb Panampullan


If you dont know much about making a game the read this book

http://www.amazon.com/dp/1430230428/?tag=stackoverfl08-20

It will teach you EVERYTHING you should need to know to do what you want. It also sets up OpenGL ES for you so your app will be nice and smooth

I really would suggest OpenGL, using the Canvas class will not only be slower but it is going to be limited as well

like image 1
Chris Avatar answered Nov 09 '22 06:11

Chris