wijesijp

Members
  • Content Count

    10
  • Joined

  • Last visited

  1. wijesijp

    How to tween with Pixi

    i add the project to fiddle https://jsfiddle.net/wijesijp/85xavjrs/10/ I remove the image add a rectangle to the code. I expected it to move but it is not moving. There are no errors on the console out also. Can you please advice how to fix this issue? Found what was wrong, i was passing elapsedMS to update function. I should have set the time.
  2. wijesijp

    How to tween with Pixi

    it is declared at the top var position; Then; position = { x: 0, y: 0, rotation: 0 }; tween = new TWEEN.Tween(position) .to({ x: 700, y: 200, rotation: 359 }, 2000) .delay(1000) .easing(TWEEN.Easing.Elastic.InOut) .onUpdate(update);
  3. wijesijp

    How to tween with Pixi

    I tried the library here https://github.com/tweenjs/tween.js/ Is there a better one to use with Pixi? The problem is I am not sure how to use the library within pixi. I noticed the my "update" function does not get a call. Also the position variable does not get updated.
  4. wijesijp

    How to tween with Pixi

    I am new to Pixi development. I am trying to tween a image. But it does not seems to work. The image is getting loaded and there are no errors. But the card image does not move. Can anyone point out what I am doing wrong? var app = new PIXI.Application({ width: 1024, height: 800, antialias: true, backgroundColor: 0xced6e2 }); var cardImg; var gameScene; var position; var tween; document.body.appendChild(app.view); function setup() { cardImg = new PIXI.Sprite( PIXI.loader.resources["images/Hearts_Q.png"].texture ); cardImg.scale.set(0.5); gameScene.addChild(cardImg); position = { x: 0, y: 0, rotation: 0 }; tween = new TWEEN.Tween(position) .to({ x: 700, y: 200, rotation: 359 }, 2000) .delay(1000) .easing(TWEEN.Easing.Elastic.InOut) .onUpdate(update); tween.start(); app.ticker.add(dt => gameLoop(dt)); } function init() { gameScene = new PIXI.Container(); app.stage.addChild(gameScene); PIXI.loader.add("images/Hearts_Q.png").load(setup); } function gameLoop() { var dt = app.ticker.elapsedMS / 1000; var result = TWEEN.update(app.ticker.elapsedMS); } function update() { cardImg.position.set(position.x, position.y); } init();
  5. wijesijp

    How to use Font.js with Pixi?

    Is there a ttf font loader in pixi?
  6. wijesijp

    How to use Font.js with Pixi?

    I am new to pixijs development. I am trying display some text using Font.js var font = new Font(); font.onload = function() { var title = new PIXI.Text("This is a test", { fontFamily: "48px A.C.M.E. Secret Agent" }); title.position.set(100, 100); gameScene.addChild(title); }; font.onerror = function(err) { console.log("font error " + err); }; font.fontFamily = "A.C.M.E. Secret Agent"; font.src = "fonts/acmesa.ttf"; But I am getting a warning Failed to decode downloaded font: data:application/x-font- OTS parsing error: post: Failed to parse table And the text is not getting displayed with the correct ttf font. Can someone post a simple example showing how to use pixijs with Font.js?
  7. wijesijp

    Can perspective view created with Pixi JS?

    I have seen several post related to this. Will this get added soon? Really like to use it in my project. Is there a place we can up vote or request features?
  8. wijesijp

    Can perspective view created with Pixi JS?

    I hope you will add it soon. It is really useful feature to have.
  9. wijesijp

    Can perspective view created with Pixi JS?

    Your card game is exactly what I wanted to do. I don't suppose full 3d will get added soon right? But can you get a perspective view like you had in the card game with current Pixi engine?
  10. Hi all, I am planing to build online black jack game. I wanted to create a perspective view environment for this game. I wanted to add animations like flipping cards, squeezing cads, dealing etc. I am looking for a game engine for this. I have not used Pixi JS before. But I do have experience with Cocos Creator. May I know whether something like this be done with Pixi JS? If it is possible can someone point to area I should be check? Greatly appreciate any help you can provide.