![](/img/trans.png)
[英]In my 1.19.2 forge mod the Item names and textures for everything are not working properly
[英]why are my textures not working?
我的紋理僅在Eclipse中起作用,但是當我嘗試將其導出為可運行的jar時,啟動它時就沒有紋理。 我創建了一個資源文件夾,並通過將其設置為類文件夾將其連接到項目,但它僅在eclipse中可用。 這就是我通常訪問紋理的方式。
Image something;
public Image getsomethingImg(){
ImageIcon s=new ImageIcon("res/something.png");
something=s.getImage();
return something;
}
然后我畫它。
g2d.drawImage(getsomethingImg(), 0, 0, null);
接下來試試這個。
ImageIcon s = new ImageIcon(getClass().getResource("res/something.png"));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.