2015-02-09 43 views
0

我使用this tutorial開始使用Overlap2D。如何在overlap2d中使用ResourceManager加載資產?

不幸的是,他們已經從DefaultAssetManager切換到ResourceManager而無需更新教程。

這是使用DefaultAssetManager的代碼。

// Initializing asset manager 
    assetManager = new ResourceManager(); 

    // providing the list of sprite animations which is one in this case, to avoid directory listing coding 
    assetManager.spriteAnimationNames = new String[1]; 
    assetManager.spriteAnimationNames[0] = "bird"; 

    // loading assets into memory 
    assetManager.loadData(); 

有沒有人有更新的教程或知道如何解決這個錯誤?

+0

assetManager.initAllResources();將加載紋理。 assetManager.spriteAnimationNames不需要... – Benjamin 2015-02-09 20:26:55

回答

0

看看這個新的教程:http://overlap2d.com/quick-start-setting-up-runtime-video/

它應該回答你所有的問題。

但簡而言之,最簡單的方法是爲場景加載器使用空的構造函數,並忘記資源管理器讓它爲您完成所有工作,或者在rm上使用initAllResources(如註釋中所述),讓它加載全部。