相关疑难解决方法(0)

在java中加载sprite图像

我想问一下为什么错误地将任何精灵图像加载到对象中

这是我如何获得图像.

import java.awt.image.BufferedImage;
import java.io.IOException;

public class SpriteSheet {
    public BufferedImage sprite;
    public BufferedImage[] sprites;
    int width;
    int height;
    int rows;
    int columns;
    public SpriteSheet(int width, int height, int rows, int columns, BufferedImage ss) throws IOException {
        this.width = width;
        this.height = height;
        this.rows = rows;
        this.columns = columns;
        this.sprite = ss;
        for(int i = 0; i < rows; i++) {
            for(int j = 0; j < columns; j++) {
                sprites[(i * columns) + j] = ss.getSubimage(i * width, …
Run Code Online (Sandbox Code Playgroud)

java bufferedimage sprite

2
推荐指数
1
解决办法
5448
查看次数

标签 统计

bufferedimage ×1

java ×1

sprite ×1