jakubdev Posted October 13, 2020 Share Posted October 13, 2020 Hello, I'm trying to stop one of tickers which animate text. As app.ticker can be removed when he knows function location in memory so I used atm hack to make it work. Allocating pulsateText function in arrow function to know exacly his location,but it makes unnecessary code. How can i achieve that easier? Quote export const finishLoading = (app, loader, resources) => { const tapAnywhereText = new PIXI.Text('Tap anywhere to start...', { fontFamily: 'Roboto', fontSize: 24, fill: 0xFFFFFF, align: 'center' }); tapAnywhereText.x = window.innerWidth / 2 - tapAnywhereText.width / 2 tapAnywhereText.y = window.innerHeight - window.innerHeight / 4 + 40; tapAnywhereText.name = 'tapAnywhereText'; const forFunctionAddress = () => pulsateText(tapAnywhereText) app.ticker.add(forFunctionAddress, forFunctionAddress); app.view.onpointerdown = (event) => { startGame(app,forFunctionAddress) }; app.stage.addChild(tapAnywhereText); } export const cleanLoadingTextures = (app, forFunctionAddress) => { app.ticker.remove(forFunctionAddress, forFunctionAddress); } 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.