j2me之游戏开发前序——图片旋转
MIDP1.0不支持旋转,现状的MIDP2.0 提供了旋转支持
TRANS_MIRROR Causes the Sprite to appear reflected about its vertical center. | |
static int | TRANS_MIRROR_ROT180 Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 180 degrees. |
static int | TRANS_MIRROR_ROT270 Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 270 degrees. |
static int | TRANS_MIRROR_ROT90 Causes the Sprite to appear reflected about its vertical center and then rotated clockwise by 90 degrees. |
static int | TRANS_NONE No transform is applied to the Sprite. |
static int | TRANS_ROT180 Causes the Sprite to appear rotated clockwise by 180 degrees. |
static int | TRANS_ROT270 Causes the Sprite to appear rotated clockwise by 270 degrees. |
static int | TRANS_ROT90 Causes the Sprite to appear rotated clockwise by 90 degrees. |
这个是从API中贴过来的,详细请参考J2ME API
下面是实现图片的旋转,图片格式png
这是个MIDlet类
Canvas类主要实现图片的旋转
实现效果见图
这里注释我也没有写多少,相信看到的人也能明白,主要是对些坐标的操作,很简单,共勉