Adding custom character textures
This commit is contained in:
parent
a3816cd725
commit
78a4bf3189
22 changed files with 262 additions and 95 deletions
|
@ -1,5 +1,6 @@
|
|||
import LoaderPlugin = Phaser.Loader.LoaderPlugin;
|
||||
import {PLAYER_RESOURCES, PlayerResourceDescriptionInterface} from "./Character";
|
||||
import {CharacterTexture} from "../../Connexion/LocalUser";
|
||||
|
||||
export interface BodyResourceDescriptionInterface {
|
||||
name: string,
|
||||
|
@ -312,6 +313,15 @@ export const loadAllLayers = (load: LoaderPlugin) => {
|
|||
}
|
||||
}
|
||||
|
||||
export const loadCustomTexture = (load: LoaderPlugin, texture: CharacterTexture) => {
|
||||
const name = 'customCharacterTexture'+texture.id;
|
||||
load.spritesheet(
|
||||
name,
|
||||
texture.url,
|
||||
{frameWidth: 32, frameHeight: 32}
|
||||
);
|
||||
}
|
||||
|
||||
export const OBJECTS: Array<PlayerResourceDescriptionInterface> = [
|
||||
{name:'layout_modes', img:'resources/objects/layout_modes.png'},
|
||||
{name:'teleportation', img:'resources/objects/teleportation.png'},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue