Loading...
Loading...
Compare original and translation side by side
Applicationawait app.init({ width, height, background })Application.resize()resizeTo: windowantialias: trueresolution: window.devicePixelRatioApplicationawait app.init({ width, height, background })Application.resize()resizeTo: windowantialias: trueresolution: window.devicePixelRatioAssets.load('path/to/image.png')Sprite.from(texture)new Sprite(texture)anchor.set(0.5)SpritesheetAssetsTexture.EMPTYAssets.load('path/to/image.png')Sprite.from(texture)new Sprite(texture)anchor.set(0.5)SpritesheetAssetsTexture.EMPTYContainersortableChildren: truezIndexParticleContainerContainersortableChildren: truezIndexParticleContainerapp.ticker.add((ticker) => { ... })ticker.deltaTimegsap.to(sprite, { x: 200, duration: 1 })AnimatedSpriteanimatedSprite.play().stop().gotoAndPlay(frame)animationSpeedapp.ticker.add((ticker) => { ... })ticker.deltaTimegsap.to(sprite, { x: 200, duration: 1 })AnimatedSpriteanimatedSprite.play().stop().gotoAndPlay(frame)animationSpeedeventMode = 'static'.on('pointerdown', handler)hitAreapointerdownglobalpointermovepointerupapp.stagecursor = 'pointer'eventMode = 'static'.on('pointerdown', handler)hitAreaapp.stagepointerdownglobalpointermovepointerupcursor = 'pointer'new Graphics()rect()circle()moveTo()lineTo()graphics.rect(0, 0, 100, 50).fill(0xff0000).stroke(0x000000)GraphicsContextapp.renderer.generateTexture()new Graphics()rect()circle()moveTo()lineTo()graphics.rect(0, 0, 100, 50).fill(0xff0000).stroke(0x000000)GraphicsContextapp.renderer.generateTexture()displayObject.filters = [new BlurFilter(4)]BlurFilterColorMatrixFilterDisplacementFilterAlphaFilterdisplayObject.filters = [new BlurFilter(4)]BlurFilterColorMatrixFilterDisplacementFilterAlphaFilterAssets.add({ alias, src })Assets.load(alias)Assets.addBundle('game', { bg: 'bg.png', hero: 'hero.png' })await Assets.loadBundle('game')Assets.add({ alias, src })Assets.load(alias)Assets.addBundle('game', { bg: 'bg.png', hero: 'hero.png' })await Assets.loadBundle('game')ParticleContainerdestroy()app.ticker.FPSblendModeParticleContainerdestroy()app.ticker.FPSblendModereferences/api-cheatsheet.mdreferences/api-cheatsheet.mdapp.ticker.add()eventModeresizeTo: windowapp.screen.width/heightapp.ticker.add()eventModeresizeTo: windowapp.screen.width/height