Commits

Anonymous committed dfcd0cf

use a preloader module for image

Comments (0)

Files changed (4)

 "use strict";
-define(['./settings', './map', './player', './detector','./virtual',"./inventory","./hud","./dialog"],
-function(settings,map,player,detector,virtual, inventory, hud, dialog) {
+define(['./settings', './map', './player', './detector','./virtual',"./inventory","./hud","./dialog","./preload"],
+function(settings,map,player,detector,virtual, inventory, hud, dialog,preload) {
 
     var createBaseModel = function() {
         var that = {};
         button.visible = false;
 
         var img = new THREE.MeshBasicMaterial({ //CHANGED to MeshBasicMaterial
-            map:THREE.ImageUtils.loadTexture('overafrica.jpg')
+            map:preload.overafrica
         });
         img.map.needsUpdate = true; //ADDED
 

overafrica.jpg

Removed
Old image

overafrica.png

Added
New image
+"use strict";
+define([],function() {
+    return {
+        overafrica: THREE.ImageUtils.loadTexture('overafrica.png')
+    }
+});