imageМенеджер текстур

circle-info

FIrst what i want to tell you.

We can load it only from external folder.

You will ask: Why there is the 2 folder "EngineAssets"?

I answer.

Because one of them is for icon (for assembly) and the other one is for scenes (in resources)

// Textures Paths List
public static List<string> textures_paths = new List<string>();

// Adding Textures to the List (Use special order = ids like: 0, 1, 2)
textures_paths.Add("Resources/Images/player_right.png"); // 0
textures_paths.Add("Resources/Images/player_left.png");  // 1
textures_paths.Add("Resources/Images/grass.png");        // 2

// Registering Textures by "textures_paths" List
TextureManager.RegisterTextures(textures_paths);

Example for using Textures from Texture Manager

// If we already have some var with SpriteObject

playerSprite.SetTexture(1); // player facing left

playerSprite.SetTexture(0); // player facing right

Last updated