Skip to content

RTL helper system is a Unity package that helps you to manage RTL (Right To Left) in the UI.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

Drimia-Interactive/RTL-helper-system

Repository files navigation

RTL-helper-system

RTL helper system is a Unity package that helps you to manage RTL (Right To Left) in the UI. This system is for addition to localization systems with languages that are written from right to left.

This package used Arabic Letters Support For Unity. For automatic line drop, you need to use TMP insted of regular Unity's text component.

How to bring it to your project

You can bring it to your project in three different ways: downloading this repository, adding it to your project's Package Manager manifest, or through the Package Manager window.

Download

Setup

Download or clone this repository into your project in the folder Packages/com.DrimiaInteractive.RTL-helper-system.

Package Manager Manifest \ Package Manager window

Requirements

Git must be installed and added to your path.

Setup - Package Manager Manifest

The following line needs to be added to your Packages/manifest.json file in your Unity Project under the dependencies section:

"com.drimiainteractive.rtl-helper-system": "https://github.com/Drimia-Interactive/RTL-helper-system.git"

Setup - Package Manager window

From Unity 2019.3 we can install packages from git Just add the following URL according to the manual:

https://github.com/Drimia-Interactive/RTL-helper-system.git

How to use it

Components

we have several components that you can use

  • Text Rtl Helper - add this to gameobject with a regular Text component
  • Text Mesh Pro Rtl Helper - add this to gameobject with a TMP Text component
  • RectTransform Rtl Helper - add this to gameobject with a RectTransform component
  • RectTransform With Children Rtl Helper - add this to gameobject with a RectTransform component that you wish to convert RTL to it and all of it children gameobjects.

for the two Text component you can choose to change the text automaticly with the change of RTL or by using the function OnTextChanged

Manager

To make all the UI move between Left to Right, you just need to change one boolean.

RtlHelperSystemManager.Instance.isRightToLeft

For example, with using Unity's Localization package:

using DrimiaInteractive.RtlHelperSystem;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;

public class ChangeRtl : MonoBehaviour
{
	private void Start()
	{
		LocalizationSettings.SelectedLocaleChanged += LocalizationSettings_SelectedLocaleChanged;
	}

	private void LocalizationSettings_SelectedLocaleChanged(Locale locale)
	{
		RtlHelperSystemManager.Instance.isRightToLeft = locale.Identifier.CultureInfo.TextInfo.IsRightToLeft;
	}
}

About

RTL helper system is a Unity package that helps you to manage RTL (Right To Left) in the UI.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages