Jump to content

zlobul

Members
  • Content Count

    7
  • Joined

  • Last visited

  1. Thanks , I have submitted a new issue : https://github.com/pixijs/pixi.js/issues/7481
  2. I don't understand why this is not working ? https://www.pixiplayground.com/#/edit/zI1a807CKp1QueSLypGGO If I add the "line" object to the stage , it will appear . Building a texture and then creating a sprite from it is not working , why ? Thanks
  3. Here is the final code I wrote to make it work , not sure if there is a better way .... blueLine = new PIXI.Texture.from('img/Blue_line.png') purpleLine = new PIXI.Texture.from('img/Purple_line.png') pinkLine = new PIXI.Texture.from('img/Pink_line.png') cyanLine = new PIXI.Texture.from('img/Cyan_line.png') lastWins = new Map() // just generating random line type sprites and position them in the container const lines = [this.blueLine, this.purpleLine, this.pinkLine, this.cyanLine] for (let linePos = 0; linePos < 40; linePos++) { let texture = lines[Math.floor(Math.random(
  4. I think I managed to do it with image files: wheelContainer = new PIXI.Container() blueLine = new PIXI.Texture.from('img/Blue_line.png') purpleLine = new PIXI.Texture.from('img/Purple_line.png') pinkLine = new PIXI.Texture.from('img/Pink_line.png') cyanLine = new PIXI.Texture.from('img/Cyan_line.png') const lines = [this.blueLine, this.purpleLine, this.pinkLine, this.cyanLine] for (let i = 0; i < 40; i++) { let texture = lines[Math.floor(Math.random() * lines.length)] let newLineSprite = new PIXI.Sprite(texture) newLineSprite.anchor.set(1) newLineSprite.y = -10 - (i * 10) t
  5. Sure - https://www.pixiplayground.com/#/edit/aj27y5c_43_nRiQoOGvIv or this one : https://www.pixiplayground.com/#/edit/WLgv1hHjxtRPEUsbtr1_L Also which method will be faster , to draw the lines or to load them as Sprites from image files ? I know the amount of operations is low here - only 10 lines , but in theory loading them from .png files looks to me the faster method.
  6. Hi , I'm new to PIXI and I'm trying to create a dynamically changing column of lines using PIXI v5 . Lets say I would like to have 4 lines that will be placed in 10 vertically aligned positions. The 4 line types have different colors and length . The bottom position ( pos 0 ) should change on event, lets say on click and push the others up , the last position (10) should disappear from the group. As I dont think drawing 10 lines is optimal , I'm trying to find a way to re-use a single line Graphics. Not sure what the best approach should be - use line images
×
×
  • Create New...