Sign in to follow this  


Recommended Posts

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


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

@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?

Share this post

Link to post
Share on other sites

That's one of features I had add to TilingSprite personally :)

Look closer at , 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 ^_^ 


Share this post

Link to post
Share on other sites

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' :)


Share this post

Link to post
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.