Jump to content

Temporary assets while loading


prvi_treti
 Share

Recommended Posts

Hello there,

  As title rather implies, I just wondered if we can have a temporary asset during loading time. As assets can sometimes be tens of MB, it might be better to load a generic one only to replaced when actual asset is loaded. It is ( and I am ) more sprite oriented but Simcity 4 had a feature of showing a generic box when mod files are missing as seen here

missinglot.jpg

What I consider is using SVG outline of real sprite while loading but this can also be applied to 3D ones until certain extent I believe.

As far as I know, there is no such feature but wondered if it would worth trouble to implement.

Best regards,

 

Link to comment
Share on other sites

here is what i use:

 

first of all i ve a simple box named "no3D" with a simple box texture. (this mesh is stored in a array)

then, i use 2 functions to place meshes

 

place(what,x,y)

i five my elements a name : what_x_y

 

unplace(what,x,y) (unload ^^)

function unplace(koi,x,y) {scene.getMeshByName(koi+'_'+x+'_'+y).dispose();}

 

so when i use assetsManager i have somethink like:

if( unknow element)

{

assetsManager.reset();

place("no3D",x,y);

var aTask = assetsManager.addMeshTask(koi, "", "bb/"+koi+"/", koi+".babylon");
aTask.onSuccess = function(task) { unplace("no3D",x,y);  ... };

assets.Manager.load();

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...