Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The arguments of Filter should not be uv coord. #57

Open
finscn opened this issue Oct 12, 2017 · 0 comments
Open

The arguments of Filter should not be uv coord. #57

finscn opened this issue Oct 12, 2017 · 0 comments

Comments

@finscn
Copy link
Contributor

finscn commented Oct 12, 2017

Example :
the center of ShockwaveFilter used uv coord, the x/y is [0.0 , 1.0].

When user want to use it , have to do some transform.

I know the transform is easy , but uv is the low layer in renderer, it should be black-box for the game coder.

And in real case , e.g. : a stone drop into a water .
The logic of game should be :

// water is a Sprite object.

var filter = new Shockwave(store.position);
water.filters = [filter];

It's easy and clear.

if Shockwave.center use uv coord.

the code maybe like this :

// water is a Sprite object.

var center = new PIXI.Point(0,0);
center.x = store.position.x / app.renderer.width;
center.y = store.position.y / app.renderer.height;
var filter = new Shockwave();

In fact , use app.renderer.width & app.renderer.height is wrong.
it's need use filterArea. but user can't get the filterArea easily.

So I think the filter should use screen/viewport/pixel coord, and filter do transform internal .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants