J2ME似雪碧在Android [英] J2ME like Sprite on Android

查看:137
本文介绍了J2ME似雪碧在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我我工作的一个仿真每月的无用项目运行在Android J2ME程序。但现在,我坚持与J2ME雪碧实现。它采用专门的转化。

For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it.

在我的雪碧我有三个字符图像的位图。我想画第二帧镜像或旋转90度。什么是它的最佳方式?

In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would be the best way for it?

我有以下code,它描绘了给定帧无需任何转换。

I have following code that paints the given frame without any transformations.

frameX,frameY上给予精灵位图框的位置坐标。

frameX, frameY are frame position coordinates on give sprite bitmap.

Rect src = new Rect(frameX, frameY, frameX + spriteWidth, frameY + spriteHeight);
Rect dst = new Rect(paintX, paintY, paintX + spriteWidth, paintY + spriteHeight);
canvas.drawBitmap(image, src, dst, null);

据我了解我需要在画布上的一些矩阵魔法,但我一直没能想出解决办法:)

As I understand I need to make some matrix magic on the canvas, but I have not been able to figure this out :)

推荐答案

您知道,Microemulator,一个开源项目,使得可以在Android上运行J2ME code,对吧?

You do know that Microemulator, an open source project, makes it possible to run J2ME code on Android, right?

http://www.microemu.org/

您总是可以看看,看看他们做什么。

You could always have a look and see what they do.

这篇关于J2ME似雪碧在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆