Show / Hide Table of Contents

Class UserTextureUtil

Inheritance
System.Object
UserTextureUtil
Namespace: Eco.Gameplay.Systems.UserTextures
Assembly: Eco.Gameplay.dll
Syntax
public static class UserTextureUtil : Object

Methods

CreateRandomPictureItem(Int32, String, User)

Get a picture item filled with a randomly generated image from the given user (or a new test user if null is passed)

Declaration
public static Task<PictureItem> CreateRandomPictureItem(int sizeMultiplier = 1, string name = null, User user = null)
Parameters
Type Name Description
System.Int32 sizeMultiplier
System.String name
User user
Returns
Type Description
System.Threading.Tasks.Task<Eco.Mods.TechTree.PictureItem>

CreateRandomUserTexture(Int32, String, User)

Make a user texture created by a given user (or new test user, if not set) and fill it with random bytes.

Declaration
public static Task<UserTexture> CreateRandomUserTexture(int sizeMultiplier = 1, string name = null, User user = null)
Parameters
Type Name Description
System.Int32 sizeMultiplier
System.String name
User user
Returns
Type Description
System.Threading.Tasks.Task<UserTexture>

CreateSpecificSizePictureItem(Int32, Int32, String, User)

Get a picture item filled with a randomly generated image from the given user (or a new test user if null is passed)

Declaration
public static Task<PictureItem> CreateSpecificSizePictureItem(int width = 1024, int height = 1024, string name = null, User user = null)
Parameters
Type Name Description
System.Int32 width
System.Int32 height
System.String name
User user
Returns
Type Description
System.Threading.Tasks.Task<Eco.Mods.TechTree.PictureItem>

GenerateDummyJpeg(String, Int32, Int32)

Declaration
public static byte[] GenerateDummyJpeg(string name, int width, int height)
Parameters
Type Name Description
System.String name
System.Int32 width
System.Int32 height
Returns
Type Description
System.Byte[]

GenerateUserTextureWithSpecificSize(Int32, Int32, String, User)

Make a user texture created by a given user (or new test user, if not set) and fill it with random bytes.

Declaration
public static Task<UserTexture> GenerateUserTextureWithSpecificSize(int width, int height, string name = null, User user = null)
Parameters
Type Name Description
System.Int32 width
System.Int32 height
System.String name
User user
Returns
Type Description
System.Threading.Tasks.Task<UserTexture>

ResizeJPGTexture(Byte[], Int32, Int32)

Resizes picture in jpeg format up to maxDimension x maxDimension pixels. It will respect existing ratio by lowering one of two dimensions.

Declaration
public static byte[] ResizeJPGTexture(byte[] bytes, int minDimension, int maxDimension)
Parameters
Type Name Description
System.Byte[] bytes
System.Int32 minDimension
System.Int32 maxDimension
Returns
Type Description
System.Byte[]
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾