6

我正在使用框架 GameClosure 但在尝试创建过滤器时遇到错误。我去看了Docs

在 DevKit Docs 我发现了这个:

GameClosure DevKit 文档 - 类:ui.filter.Filter

import ui.filter.Filter as Filter;

var filter = new Filter();

这是错误:

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
4

2 回答 2

4

我有同样的问题。我调查了 ui.filter 的目录。Filter看看这是否是错误。

我发现directory was wrong.

在 ui 中没有目录filter.Filter.jsfilter.js在 ui 中(使用 F tiny 过滤)。

解决方案:更改中的导入ui.filter as filter,它应该可以工作。

于 2013-11-11T11:59:17.090 回答
3

Giglio 的回答会奏效。我们在游戏中使用的另一种方法如下所示:

from ui.filter import LinearAddFilter;

或者

from ui.filter import MultiplyFilter;

LinearAddFilter 和 MultiplyFilter 类经过充分测试,在本机和浏览器中运行得相当快。

该文件中还有其他几个过滤器类,您可以从中选择它们将在浏览器中运行,但在本机端没有经过很好的测试并且往往速度较慢,因此我们避免使用它们。

于 2013-11-12T19:58:44.967 回答