2017-05-11 05:13:52 +02:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Cyber.Util {
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Text texture properties. See <see cref="TextTextureRenderer"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[System.Serializable]
|
|
|
|
|
public struct TextTextureProperties {
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The text.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Text;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-05-12 03:59:58 +02:00
|
|
|
|
/// The offset on the x-axis in pixels.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int OffsetX;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The offset on the y-axis in pixels.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int OffsetY;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The offset on the y-axis in pixels.
|
2017-05-11 05:13:52 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
public Color Background;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The size of the font.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int FontSize;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The width of the texture.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Width;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The height of the texture.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Height;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates new properties for a specified kind of text. See
|
|
|
|
|
/// <see cref="TextTextureRenderer"/> for usage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">Text.</param>
|
2017-05-12 05:07:16 +02:00
|
|
|
|
/// <param name="offsetX">X offset.</param>
|
|
|
|
|
/// <param name="offsetY">Y offset.</param>
|
2017-05-11 05:13:52 +02:00
|
|
|
|
/// <param name="background">Background.</param>
|
|
|
|
|
/// <param name="fontSize">Font size.</param>
|
|
|
|
|
/// <param name="width">Width.</param>
|
|
|
|
|
/// <param name="height">Height.</param>
|
2017-05-12 03:59:58 +02:00
|
|
|
|
public TextTextureProperties(string text, int offsetX = 0,
|
|
|
|
|
int offsetY = 0, Color background = new Color(),
|
|
|
|
|
int fontSize = 32, int width = 256, int height = 256) {
|
2017-05-11 05:13:52 +02:00
|
|
|
|
Text = text;
|
2017-05-12 03:59:58 +02:00
|
|
|
|
OffsetX = offsetX;
|
|
|
|
|
OffsetY = offsetY;
|
2017-05-11 05:13:52 +02:00
|
|
|
|
Background = background;
|
|
|
|
|
FontSize = fontSize;
|
|
|
|
|
Width = width;
|
|
|
|
|
Height = height;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|