sachin Posted February 8, 2019 Share Posted February 8, 2019 I am developing a game in which i have to click an image .after click it will flip and show prize after that i have to move this image and prize towards prize-board.during this movement i have to scale these images to fit into prize-board slot .how to solve this problem. please help Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 8, 2019 Share Posted February 8, 2019 tween "width" and "height", i guess? Quote Link to comment Share on other sites More sharing options...
sachin Posted February 8, 2019 Author Share Posted February 8, 2019 yes Quote Link to comment Share on other sites More sharing options...
Exca Posted February 8, 2019 Share Posted February 8, 2019 I would suggest using some kind of tweening library. I myself use tweenJS but there's plenty of them available. In tweenjs you could say something like this: Tween.get( yourSprite).to({ x: targetposition.x, y: targetposition.y, width: target.width, height:target.height}, 500); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 8, 2019 Share Posted February 8, 2019 Yeah, what @Exca said. I forgot that you might not know that pixi doesnt have built-in tweens. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.