Texture

csharp
public sealed class Texture : Asset

Namespace NodeWorld.Flux.

A texture of the world: a field set from the scene, a material's, or one a script loaded (Texture.LoadFromUrl, ImageConversion.LoadImage).

Properties

width

csharp
public int width { get; }

Width in pixels.

height

csharp
public int height { get; }

Height in pixels.

Methods

LoadFromUrl

csharp
public static async Task<Texture> LoadFromUrl(string url, CancellationToken cancellationToken = default)

Loads a PNG or JPG image from an address (http, https) into a new texture of the world. On the player's client the address goes through the network gate (the player allows its hostname); the task fails with HttpRequestException when the request does, InvalidOperationException when the bytes are not an image.