B4W warnings and errors explained
11 August 2015 18:37
Often I will get B4W warnings that are often not (as far as I've been able to track down) documented, so I will post the ones I've so far been unable to resolve here.
First up:
"Couldn't determine path to ancillary resources, fallback to the current page directory"
I may have missed something, but my directory references look ok to me. Is B4W looking for a specific arrangement of folders/naming convention?
First up:
"Couldn't determine path to ancillary resources, fallback to the current page directory"
I may have missed something, but my directory references look ok to me. Is B4W looking for a specific arrangement of folders/naming convention?
11 August 2015 19:03
Hi,
This warning is thrown by the config module. Upon startup, the engine tries to automatically detect the path for loading external dependencies, namely uranium and smaa textures. Finding the path will fail if you rename your b4w.min.js (or b4w.full.min.js) file, for example.
We did not document the browser console warnings and errors yet because they are subject to frequent updates. This particular situation, however, should be documented asap.
This warning is thrown by the config module. Upon startup, the engine tries to automatically detect the path for loading external dependencies, namely uranium and smaa textures. Finding the path will fail if you rename your b4w.min.js (or b4w.full.min.js) file, for example.
We did not document the browser console warnings and errors yet because they are subject to frequent updates. This particular situation, however, should be documented asap.
12 August 2015 07:44
25 November 2015 07:54
I have a new warning I want to learn the cause of (also I need the canvas to be scalable):
Wrong canvas container dimensions: 1920x0. Zero dimensions aren't allowed. Resized to: 320x240.
My code is below (attach isn't working):
Wrong canvas container dimensions: 1920x0. Zero dimensions aren't allowed. Resized to: 320x240.
My code is below (attach isn't working):
<!DOCTYPE html>
<html>
<head>
<script src="b4w.min.js"></script>
<script>
var m_app = b4w.require("app");
var m_data = b4w.require("data");
var m_cfg = b4w.require("config");
var m_cont = b4w.require("container");
m_app.init({
canvas_container_id: "body_id",
callback: init_cb,
physics_enabled: false,
alpha: true,
autoresize: true
});
function init_cb(canvas_elem, success) {
if (!success) {
console.log("b4w init failure");
return;
}
m_app.enable_controls();
load();
}
function load() {
m_data.load("blend_data/skull_v8.json", load_cb);
}
function load_cb(data_id) {
m_app.enable_camera_controls();
}
</script>
<style>
#body_id {
width: 100%;
height: 100%;
margin-top:10px !important;
position:relative;
}
</style>
</head>
<body id="body_id" bgcolor="gray">
</body>
</html>
25 November 2015 13:53
I have a new warning I want to learn the cause of (also I need the canvas to be scalable):This is because the body element (which in your case is a canvas container) has zero height. You can add CSS property to its style:
Wrong canvas container dimensions: 1920x0. Zero dimensions aren't allowed. Resized to: 320x240.
"position: absolute". Thus it will rescale to the window size. But anyway the better approach is to have a separate container.