第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

LibGDX, GDX.files.internal() 找不到文件

LibGDX, GDX.files.internal() 找不到文件

浮云間 2022-01-12 14:00:45
我在使用帶有資產(chǎn)目錄的 LibGDX 時(shí)遇到問(wèn)題。其實(shí),我建我的項(xiàng)目文件夾這樣。我按照本教程學(xué)習(xí)。(我在 Eclipse 上工作)我使用的代碼是:package com.mygdx.game;import com.badlogic.gdx.ApplicationListener;import com.badlogic.gdx.Gdx;import com.badlogic.gdx.graphics.GL20;import com.badlogic.gdx.graphics.g2d.Sprite;import com.badlogic.gdx.graphics.g2d.SpriteBatch;import com.badlogic.gdx.graphics.g2d.TextureAtlas;import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;import com.badlogic.gdx.utils.Timer;import com.badlogic.gdx.utils.Timer.Task;public class MyGdxGame implements ApplicationListener {    private SpriteBatch batch;    private TextureAtlas textureAtlas;    private Sprite sprite;    private int currentFrame = 1;    private String currentAtlasKey = new String("0001");    @Override    public void create() {                batch = new SpriteBatch();        // THE PROBLEM IS UNDER THIS LINE        textureAtlas = new TextureAtlas(Gdx.files.internal("spritesheet.atlas"));        AtlasRegion region = textureAtlas.findRegion("0001");        sprite = new Sprite(region);        sprite.setPosition(120, 100);        sprite.scale(2.5f);        Timer.schedule(new Task(){            ,0,1/30.0f);    }(如果代碼難以閱讀,我使用與下面鏈接的教程中完全相同的代碼)我的包瀏覽器看起來(lái)像這樣: imgur link它返回給我:線程“LWJGL 應(yīng)用程序”com.badlogic.gdx.utils.GdxRuntimeException 中的異常:找不到文件:com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136) 處的 spritesheet.atlas(內(nèi)部)com.badlogic .gdx.graphics.g2d.TextureAtlas$TextureAtlasData.(TextureAtlas.java:103) 在 com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:231) 在 com.badlogic.gdx.graphics.g2d.TextureAtlas .(TextureAtlas.java:226) 在 com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:216) 在 com.mygdx.game.MyGdxGame.create(MyGdxGame.java:23) 在 com.badlogic。 gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)我嘗試了一些技巧,例如 Project>Clean、刷新、關(guān)閉和重新打開(kāi) Eclipse,甚至重新創(chuàng)建了一個(gè)項(xiàng)目。任何的想法 ?
查看完整描述

2 回答

?
慕姐8265434

TA貢獻(xiàn)1813條經(jīng)驗(yàn) 獲得超2個(gè)贊

好吧,我找到了訣竅。對(duì)于那些遇到相同問(wèn)題的人(在 Eclipse 上工作,但無(wú)論 IDE 是什么都一樣),已經(jīng)存在一個(gè)堆棧溢出線程,它提供了額外的解決方案。對(duì)我來(lái)說(shuō),我必須設(shè)置“工作目錄”(例如桌面主目錄)。為此,請(qǐng)繼續(xù)運(yùn)行>運(yùn)行配置>參數(shù),在工作目錄的部分有默認(rèn)和其他。勾選Other's box我不得不寫(xiě)${workspace_loc:my-gdx-game-core/assets}但我認(rèn)為它的工作方式類(lèi)似于${workspace_loc:[name-of-your-core-directory]/assets}。希望它有所幫助。


查看完整回答
反對(duì) 回復(fù) 2022-01-12
?
猛跑小豬

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊

也許你沒(méi)有鏈接資產(chǎn)文件夾,如果是這樣,

嘗試右鍵單擊 my-gdx-game-desktop,在屬性對(duì)話框中選擇 Java Build Path,單擊鏈接源按鈕,然后導(dǎo)航到 assets 文件夾。

如果您已經(jīng)設(shè)置它,請(qǐng)嘗試使用此步驟讀取,如果需要重新啟動(dòng) eclipse


查看完整回答
反對(duì) 回復(fù) 2022-01-12
  • 2 回答
  • 0 關(guān)注
  • 292 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)