# EmbededResources

Fields
Methods

No fields

GetBytes
LoadSprite

# Constructors

No constructors


# Fields

No fields


# Methods

# GetBytes(name): byte[]

Get byte array representation of data for specific resource from embeded resoruces

Parameter Type Optional Description
name string No The name(path) of resource

Returns: byte[]

Examples:

//Your mod named as `Super Mod` in mod.json, and you want 
//to get bytes for resource, which located in EmbededResource/images/coolImage.png

byte[] coolImageBytes = Mod.EmbededResources.GetBytes("Super Mod.Resources.images.coolImage.png");

//Then you can convert byte array by some way to anything which you need
//Your mod named as `Super Mod` in mod.json, and you want 
//to get bytes for resource, which located in EmbededResource/cool images/cool Image.png

byte[] coolImageBytes = Mod.EmbededResources.GetBytes("Super Mod.Resources.cool_images.cool_Image.png");

//Note that if you have spaces in your mod name, you using it as it is, with spaces as name parameter
//But if you have spaces in folder/file name, it should be replaced with _ symbol

# LoadSprite(name, offsetX = 0, offsetY = 0): UnityEngine.Sprite

Get UnityEngine.Sprite from EmbededResources

Parameter Type Optional Description
name string No The name(path) of resource, which represents image file
offsetX float Yes Pivot offset X
offsetY float Yes Pivot offset Y

Returns: UnityEngine.Sprite

Examples:

//Your mod named as `Super Mod` in mod.json, and you want 
//to create sprite from image, which located in EmbededResource/coolImage.png

var sprite = Mod.EmbededResources.LoadSprite("Super Mod.Resources.coolImage.png");