Jump to content

Changing Texture Frame updates all textures


computern
 Share

Recommended Posts

Hi,

I am currently having an issue where changing the frame of a texture for one sprite is updating the frame of the texture on all my sprites. I want each sprite to use the same texture but be able to display a different frame of it.

(Please note I am using Pixi.js 4.5.1 as it doesnt break my game)

my code:

let outlineskin = resources["Resources/mask.png"].texture;
outlineskin.frame = new PIXI.Rectangle(20*number,0,20,40);
this.outline.texture = outlineskin;

but by changing the frame of mask.png it updates every sprite that has the texture mask.png to that frame.

I need to be able to constantly change the frame as the sprite moves.

I presume there is a better way to code this,

any help would be much appreciated

Link to comment
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...