mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-19 06:46:28 +01:00
Fix calculateVertices issues
This commit is contained in:
parent
325482fe7e
commit
16807ff08f
@ -1,5 +1,5 @@
|
|||||||
export * from './GraphicAsset';
|
export * from './GraphicAsset';
|
||||||
export * from './GraphicAssetCollection';
|
//export * from './GraphicAssetCollection';
|
||||||
export * from './GraphicAssetPalette';
|
export * from './GraphicAssetPalette';
|
||||||
export * from './IGraphicAsset';
|
export * from './IGraphicAsset';
|
||||||
export * from './IGraphicAssetCollection';
|
export * from './IGraphicAssetCollection';
|
||||||
|
@ -549,11 +549,11 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
|
|||||||
{
|
{
|
||||||
if((index < 0) || (index >= this._spriteCount)) return null;
|
if((index < 0) || (index >= this._spriteCount)) return null;
|
||||||
|
|
||||||
const sprite = this._display.getChildAt(index);
|
const sprite = (this._display.getChildAt(index) as ExtendedSprite);
|
||||||
|
|
||||||
if(!sprite) return null;
|
if(!sprite) return null;
|
||||||
|
|
||||||
return sprite as ExtendedSprite;
|
return sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getExtendedSpriteIdentifier(sprite: ExtendedSprite): string
|
protected getExtendedSpriteIdentifier(sprite: ExtendedSprite): string
|
||||||
@ -678,7 +678,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
|
|||||||
extendedSprite.offsetX = sprite.offsetX;
|
extendedSprite.offsetX = sprite.offsetX;
|
||||||
extendedSprite.offsetY = sprite.offsetY;
|
extendedSprite.offsetY = sprite.offsetY;
|
||||||
extendedSprite.name = sprite.name;
|
extendedSprite.name = sprite.name;
|
||||||
extendedSprite.varyingDepth = sprite.varyingDepth;
|
extendedSprite.varyingDepth = sprite.varyingDepth;
|
||||||
extendedSprite.clickHandling = sprite.clickHandling;
|
extendedSprite.clickHandling = sprite.clickHandling;
|
||||||
extendedSprite.blendMode = sprite.blendMode;
|
extendedSprite.blendMode = sprite.blendMode;
|
||||||
extendedSprite.filters = sprite.filters;
|
extendedSprite.filters = sprite.filters;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BaseTexture, BLEND_MODES, Point, Renderer, RenderTexture, Sprite, Texture } from 'pixi.js';
|
import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js';
|
||||||
import { Nitro } from '../../../nitro/Nitro';
|
import { Nitro } from '../../../nitro/Nitro';
|
||||||
|
|
||||||
export class ExtendedSprite extends Sprite
|
export class ExtendedSprite extends Sprite
|
||||||
@ -38,20 +38,11 @@ export class ExtendedSprite extends Sprite
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(renderer: Renderer): void
|
public calculateVertices(): void
|
||||||
{
|
{
|
||||||
try
|
if(!this.texture.orig) return;
|
||||||
{
|
|
||||||
//@ts-ignore
|
|
||||||
if(!this._texture || !this._texture._uvs || !this._texture._uvs.uvsFloat32) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (err)
|
super.calculateVertices();
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.render(renderer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public setTexture(texture: Texture): void
|
public setTexture(texture: Texture): void
|
||||||
|
Loading…
Reference in New Issue
Block a user