javalang 87 Report post Posted September 12, 2017 Hello, I'm asking because I'm not sure of my understanding the PIXI.basetexture WRAP_MODES: For example: given one container, one texture (loaded with loader) and one smaller sprite, defining PIXI.WRAP_MODES.REPEAT should fill the whole container, but it doesn't. The following code shows a sprite inbetween the container without repeating, what I'm doing wrong ? see WRAPMODE_TEST_HERE Thanks in advance PS: using PIXI 4.5.5 loader.load((loader, ressources) => { var texture = ressources.rgba.texture; texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT; var sprite = new PIXI.Sprite(texture); sprite.width = 312 sprite.height = 312 stage.addChild(sprite); ... }) Quote Share this post Link to post Share on other sites
ivan.popelyshev 1071 Report post Posted September 12, 2017 What is the texture size? Also, its better to use TilingSprite for that case, and REPEAT will add performance to it. Quote Share this post Link to post Share on other sites
ivan.popelyshev 1071 Report post Posted September 12, 2017 In general, REPEAT is passed to WebGL, it does not affect stage tree. However there are some cases where it also can be used, like DisplacementFilter. Its not possible to understand its logic and why certain elements can be affected by it, unless you start working with WebGL directly. Quote Share this post Link to post Share on other sites
javalang 87 Report post Posted September 12, 2017 @ivan.popelyshev thanks for reply, TilingSprite is not suitable for me because my scale factors are not whole numbers. I added a link of the testcase in the first thread . So you think I should implement the repeat function for example in a filter? Edit: Changed my scenario to TilingSprite, using tileScale and tilePosition works fine now, but how to rotate? 1 ivan.popelyshev reacted to this Quote Share this post Link to post Share on other sites
ivan.popelyshev 1071 Report post Posted September 12, 2017 That's one of features I had add to TilingSprite personally Look closer at https://github.com/pixijs/pixi.js/blob/dev/src/extras/TilingSprite.js#L116 , TilingSprite have actual transform on the inside! You can specify not only position and scale but also other things! You might want to synchronize it with some other container to create elements that will live "on top" of that tilingSprite. Btw, nice nickname! I'm also java/scala/kotlin developer 1 javalang reacted to this Quote Share this post Link to post Share on other sites
javalang 87 Report post Posted September 12, 2017 I understand, I will test it. BTW , better java/kotlin/scala than FORTRAN But, since I changed to javascript, i will never change to java again, I should change the Nic to something like 'javascriptfunction' Quote Share this post Link to post Share on other sites
javalang 87 Report post Posted September 12, 2017 @ivan.popelyshev So the short answer is: this.sprite.tileTransform.rotation = props.rotation * Math.PI / 180; and it works , thank you 1 ivan.popelyshev reacted to this Quote Share this post Link to post Share on other sites