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;
|
|
|
|
|
|
2017-05-12 20:27:01 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the text is centered or not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Centered;
|
|
|
|
|
|
2017-05-12 03:59:58 +02:00
|
|
|
|
/// <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 20:27:01 +02:00
|
|
|
|
/// <param name="offsetX">Offset x.</param>
|
|
|
|
|
/// <param name="offsetY">Offset y.</param>
|
|
|
|
|
/// <param name="centered">If set to <c>true</c> centered.</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,
|
2017-05-12 20:27:01 +02:00
|
|
|
|
int offsetY = 0, bool centered = false,
|
|
|
|
|
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-12 20:27:01 +02:00
|
|
|
|
Centered = centered;
|
2017-05-11 05:13:52 +02:00
|
|
|
|
Background = background;
|
|
|
|
|
FontSize = fontSize;
|
|
|
|
|
Width = width;
|
|
|
|
|
Height = height;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|