锁定老帖子 主题:第一次亲密接触J2ME游戏
精华帖 (0) :: 良好帖 (3) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-10-21
谢谢指点,我感觉现在j2me还是很有前途的
|
|
返回顶楼 | |
发表时间:2009-10-21
能提一提你看了哪些源代码不?
|
|
返回顶楼 | |
发表时间:2009-10-21
shhbobby 写道 能提一提你看了哪些源代码不? 看了一下网上的二人麻将,俄罗斯,连连看的源代码。 |
|
返回顶楼 | |
发表时间:2010-02-04
做游戏要有美工支持才行
|
|
返回顶楼 | |
发表时间:2010-02-05
g.drawImage(birdImg, birdAppearX, birdAppearY, 0); 请问anchor为什么是0? |
|
返回顶楼 | |
发表时间:2010-02-05
这个不会用图像数组吗?
# //换图片,bird1Img,bird2Img,bird3Img已经实例化过,最好是一张大图包含若干小鸟状态 # Image birdImg = null; # if (birdCount % 3 == 0) { # birdImg = bird1Img; # } else if (birdCount % 3 == 1) { # birdImg = bird2Img; # } else if (birdCount % 3 == 2) { # birdImg = bird3Img; # } |
|
返回顶楼 | |
发表时间:2010-02-05
鸟哥哥 写道 g.drawImage(birdImg, birdAppearX, birdAppearY, 0); 请问anchor为什么是0? 关于参数的说明,可以参考api的说明啊 |
|
返回顶楼 | |
发表时间:2010-02-05
稻-草 写道 这个不会用图像数组吗?
# //换图片,bird1Img,bird2Img,bird3Img已经实例化过,最好是一张大图包含若干小鸟状态 # Image birdImg = null; # if (birdCount % 3 == 0) { # birdImg = bird1Img; # } else if (birdCount % 3 == 1) { # birdImg = bird2Img; # } else if (birdCount % 3 == 2) { # birdImg = bird3Img; # } 恩,多谢啊,用一个数组来表示是一个好办法,只是在内存的占用上并没有什么优势。 |
|
返回顶楼 | |
发表时间:2010-02-05
sharong 写道 鸟哥哥 写道 g.drawImage(birdImg, birdAppearX, birdAppearY, 0); 请问anchor为什么是0? 关于参数的说明,可以参考api的说明啊 对,我就是发现没这个参数,才发问的。 我做j2me那么久,第一次发现用这个参数的。 |
|
返回顶楼 | |
发表时间:2010-02-07
鸟哥哥 写道 sharong 写道 鸟哥哥 写道 g.drawImage(birdImg, birdAppearX, birdAppearY, 0); 请问anchor为什么是0? 关于参数的说明,可以参考api的说明啊 对,我就是发现没这个参数,才发问的。 我做j2me那么久,第一次发现用这个参数的。 下面是wtk3.0对drawImage方法的说明,我用的wtk是3.0,是不是2.5.2版的drawImage方法有一些不同? drawImage public void drawImage(Image img, int x, int y, int anchor) Draws the specified image by using the anchor point. The image can be drawn in different positions relative to the anchor point by passing the appropriate position constants. See anchor points. If the source image contains transparent pixels, the corresponding pixels in the destination image must be left untouched. If the source image contains partially transparent pixels, a compositing operation must be performed with the destination pixels, leaving all pixels of the destination image fully opaque. If img is the same as the destination of this Graphics object, the result is undefined. For copying areas within an Image, copyArea should be used instead. Parameters: img - the specified image to be drawn x - the x coordinate of the anchor point y - the y coordinate of the anchor point anchor - the anchor point for positioning the image Throws: IllegalArgumentException - if anchor is not a legal value NullPointerException - if img is null See Also: Image |
|
返回顶楼 | |