Script references

All scripts are in namespace MText. So, don’t forget to add using MText on top of the script when referencing scripts on this asset.

Modular3DText.cs

Method/variable

Type

Description

Text

String

Text string of the 3D text

Material

material

FontSize

vector3

CharacterSpacing

float

LineSpacing

float

Width

float

Height

float

Capitalize

bool

LowerCase

bool

pooling

bool

Enables/Disables the usage of pooling

EmptyEffect(List <effect> effectList)

Method

To add new effects runtime, Call this method and pass it typingEffects or deletingEffects. This will create a new empty effect slot. Assign a Module and duration to it.

TextAnchor

TextAnchor

Sets the alignment of the 3D text

assetPath

string

Where the prefab is saved.

Is only used when prefab connection is broken via break prefab connection button in Advanced Settings to store the path to be used by reconnect prefab button

characterObjectList

List<GameObject>

List of character objects created by the text

Modifiable attributes via script: material, characterSpacingInput for character spacing, lineSpacingInput for line spacing, height, length

MText_Font.cs

Method/variable

Type

Description

RetrievePrefab(char c)

Method

Returns prefab of the character. Returns null if nothing found

monoSpaceFont

Bool

Mono space fonts are fonts with equal distance to each character. For example, the character ‘I’ will occupy same space as ‘A’.

Spacing(char c)

Method

Returns the area (spacing) a character will occupy in non-mono spaced font.

characters

List of

MText_Character

Each MText_Character has a character, prefab and spacing information

monoSpaceFont

bool

True = all characters are equal distance to each other

emptySpaceSpacing

Float

How large of an area should empty space be taking

MText_UI_List.cs

Method/variable

Type

Description

UpdateList()

Method

Repositions list items

Focus(bool enable)

Method

Makes list active or deactive to keyboard controls.

Enabling focus has a one frame delay.This is to avoid pressing “Enter” in one list, enabling another list which also takes the “Enter” input and presses it’s button

Focus(bool enable, bool delay)

Method

Makes list active or deactive to keyboard controls without delay if second parameter is set to false.

SelectItem (int i)

Method

Selects i number child

UnSelectSpecific (MText_UI_Button button)

Method

Unselects button graphic

UnselectEverything ()

Method

Unselects everything

Mtext_UI_InputField

Type

Description

Text

string

Current input

Focus(bool enable)

method

Enables/Disables input. Enabling has a one frame delay

Focus(bool enable, bool delay)

Method

Enables/Disables input. Enabling delay depends on second parameter.

background

Renderer

Background. That’s all Folks!

inFocusBackgroundMat

Material

Material assigned to background when input is active

onInput

Unity Event

Events are called when a new character is added,

onBackSpace

Unity Event

Events are called when a character is removed

onInputEnd

Unity Event

Called when input is complete. Dictated by Enter key

InputComplete()

Method

Completes input, invokes oninputEnd

interactable

Bool

Will touch/click enable it or selectable in a list

text

Modular3DText

The text object for this input

SelectedVisual()

UnselectedVisual()

DisableVisual()

Method

Sets the visual style

Uninteractable()

Method

Disables interaction

Interactable()

Method

Enables interaction

UpdateText(), UpdateText(string), UpdateText(int), UpdateText(float)

Method

Updates Text.

Updating the "Text" variable directly also updates them

MText_UI_Button

Method/variable

Type

Description

PressButton()

Method

Presses the button

SelectButton()

Method

Selects the button

UnselectedButtonVisualUpdate()

PressButtonVisualUpdate()

SelectedButtonVisualUpdate()

DisabledButtonVisualUpdate()

Method

Applies style to graphic only. No function change.

Uninteractable()

Method

Disables interaction

Interactable()

Method

Enables interaction

LoadDefaultSettings()

Method

Resets button settings from Settings file

Some modifiable properties like normalBackgroundMaterial, pressedBackgroundMaterial, selectedBackgroundMaterial etc.

MText_UI_Toggle

Method/variable

Type

Description

IsOn

bool

As the name suggests.

Set (bool)

Method

Specificly set the toggle

Toggle ()

Method

Toggles the toggle.

ActiveVisualUpdate(),

InactiveVisualUpdate()

Method

Applies just the style. Setting the IsOnwill automatically update the visual too.

Toggle is controlled by button. Set button‘s interactable property to control toggle

MText_UI_Slider

Method/variable

Type

Description

Focus(bool enable)

Method

Enables/Disables slider to mouse/touch control

UpdateValue(int newValue)

UpdateValue(float newValue)

Method

Use it to update slider value

SelectedVisual()

UnSelectedVisual()

ClickedVisual()

DisabledVisual()

Method

Updates the visual of the slider

Uninteractable()

Method

Disables interaction

Interactable()

Method

Enables interaction

HorizontalSelector

Variable

Type

Description

text

Modular3DText

The 3D text used to show the current value

selected

bool

interactable

bool

options

string list

Options available for the selector

value

int

keyboardControl

bool

increaseKey

KeyCode

decreaseKey

KeyCode

valueChangeSoundEffect

AudioClip

audioSource

AudioSource

onValueChangedEvent

UnityEvent

onSelectEvent

UnityEvent

Method

Description

Increase

Increases currently selected number by 1

Decrease

Decreases currently selected number by 1

Note: Nothing in the MText.FontCreation namespace is meant to be used by anything other than what it does already. The code is quiet messy and hard to provide support for since I am not very knowledgeable about mesh genaration. So, wrapping it in a DLL. Will slowly organize stuff and move some pieces of them out of DLL one by one later. if I have the time. (Low priority). Update to 1.4.2: moved most code out of DLL. (mesh+obj exporter, different helper scripts) Just triangulation script is in DLL.

API Change-list

[This is not asset version change list. It is just API change.] Version 2.0.0 Most public text variables are properties now, will auto update the text if changed.

Version 1.6.9 1. Input String has been renamed to input field 2. Toggle's "active" variable has been renamed to "isOn" to match with Unity's UI. 3. Toggle's active & inactive item is game-object now, instead of a list.

Version 1.6.5 UpdateText() now updates the text no matter what. Use UpdateTextWithCheck() if you want to update if change is made to the tracked properties.

Version 1.5.03

  1. Modular 3D Text: NewEffect(the list to add module to, new module); method ClearAllEffects();

  2. StatusToolTip script replaces DamageText script to be used in a real scenerio instead of just as a sample

Version 1.4.02

  1. Few more scripts are out of DLL.

  2. In-editor font creator can export font as mesh instead of OBJ too and the scripts are out of DLL. They aren't really useful for anything outside of font creation. Not putting them in Scripting references to avoid clutter.

Version 1.4.01

  1. Slider Value range events have been added

  2. Text has new bool activateChildObjects. This creates child characters as inactive.

Version 1.4.0

  1. bool useUpperCaseLettersIfLowerCaseIsMissing added to Font class. Does what it says.

  2. Nothing in the MText.FontCreation namespace is meant to be used by anything other than what it does already. The code is quiet messy and hard to provide support for. So, wrapping it in a DLL. Will slowly organize stuff and move out of DLL one by one.

Version 1.3.23

  1. Slider & Input string visual update methods now take style options from List just like buttons

  2. PressButtonDontCallList() is a new method to press a button without calling the parent list. Primarily used by List itself to avoid recursive calls by PressButton()

  3. InputField now has public UpdateText(), UpdateText(string), UpdateText(int), UpdateText(float)

  4. Modular3DText.cs && MText_UI_Button now has a LoadDefaultSettings() method that does what it says.

Last updated