daintycode Posted November 2, 2017 Share Posted November 2, 2017 Can we do something like Image.drawWarped (link goes to the javadoc of slick2d) with pixi.js? It gave devs the possibility to define where to render the 4 corners of an image with absolute x, y locations and it automatically skewed the image to fit in. I guess it just redefined the points of the triangles used to render the image or something like that. (I'm not that fit with gl, thats why I use pixi.js.^^) Thanks. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 2, 2017 Share Posted November 2, 2017 https://github.com/pixijs/pixi-projection , webgl only. There are bilinear and projectional ways to do it. http://pixijs.github.io/examples/#/projection/quad-homo.js http://pixijs.github.io/examples/#/projection/quad-bi.js daintycode 1 Quote Link to comment Share on other sites More sharing options...
daintycode Posted November 2, 2017 Author Share Posted November 2, 2017 Going to look into that, thanks. As I see this it extends Sprites with functionality, not changing their overall prototype? You're even using Typescript - actually perfect. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 2, 2017 Share Posted November 2, 2017 You can even convert your own sprite class into it, there's "convert2d" function for containers/sprites that adds necessary fields. "2d" is for sprites that use 3x3 matrix instead of pixi default 3x2, performance is the same as a simple sprite. "2s" is for general curves, in my case, billinear, its slower because of special calculations in fragment shader, math is just harder. I'm using TS for all of my plugins. Quote Link to comment Share on other sites More sharing options...
daintycode Posted November 2, 2017 Author Share Posted November 2, 2017 Whooa, checked out the examples. Works beautiful! Yeah, I see that. I think I'm going to use it, I thank you in advance.(: ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
daintycode Posted November 3, 2017 Author Share Posted November 3, 2017 I don't want to open an issue on your plugin for this and I guess it fits in here. Is there a way to define a backside, rendered where "wrapped around"? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.