I'm using the framework GameClosure but I meet an error when I tried to create a filter. I went to look at the Docs
On the DevKit Docs I found this:
GameClosure DevKit Docs - Class: ui.filter.Filter
import ui.filter.Filter as Filter;
var filter = new Filter();
This is the error:
Error loading module:
[[ import ui.filter.Filter as Filter ]]
requested by: ./src/Level0/Level0.js
current directory: http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/
Error: requested import (ui.filter.Filter) not found
looked in:
sdk/timestep/ui/filter/Filter.js
Import Stack:
0 : src.Application (./src/Application.js)
1 : src.Level0.Level0 (./src/Level0/Level0.js)
Error: requested import (ui.filter.Filter) not found
looked in:
sdk/timestep/ui/filter/Filter.js
Import Stack:
0 : src.Application (./src/Application.js)
1 : src.Level0.Level0 (./src/Level0/Level0.js)
at loadModule (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:536:11)
at importer (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:688:18)
at Object.jsio (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:81:21)
at Object.$$src_Level0_Level0 (http://127.0.0.1:8802/./src/Level0/Level0.js:4:1)
at execModuleDef (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:605:7)
at importer (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:744:6)
at Object.jsio (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:81:21)
at Object.$$src_Application (http://127.0.0.1:8802/./src/Application.js:3:1)
at execModuleDef (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:605:7)
at importer (http://127.0.0.1:8802/simulate/ricettivointermedio/native-ios/native-ios.js:744:6) native-ios.js:385
Uncaught Error: requested import (ui.filter.Filter) not found
looked in:
sdk/timestep/ui/filter/Filter.js
Import Stack:
0 : src.Application (./src/Application.js)
1 : src.Level0.Level0 (./src/Level0/Level0.js) native-ios.js:536
I had the same problem.
I investigated the directory of ui.filter. Filter
to see if that was the error.
I discovered that the directory was wrong
.
In ui there is no directory filter.Filter.js
, the filter.js
is in ui (filter with the F tiny).
SOLUTION: change the import in ui.filter as filter
, and it should work.
Giglio's answer will work. An alternative way that we have been using in our games looks like this:
from ui.filter import LinearAddFilter;
or
from ui.filter import MultiplyFilter;
The LinearAddFilter and MultiplyFilter classes are well-tested and run fairly fast on native and in the browser.
There are several other filter classes in that file that you can select from that will run in the browser, but are not well tested on the native side and tend to be slower so we avoid them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With