12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System;
- using System.Collections.Generic;
- using CommonUI.Data;
- using UnityEngine;
- using UnityEngine.UI;
- namespace CommonUnity3D.UGUI
- {
- public class ImageFontSprite : DisplayText
- {
- private ImageFontGraphics mGraphics;
- public ImageFontSprite(string name = "") : base(name)
- {
- this.Enable = false;
- this.EnableChildren = false;
- this.mGraphics = mGameObject.AddComponent<ImageFontGraphics>();
- }
- public ImageFontGraphics Graphics
- {
- get { return mGraphics; }
- }
- public override string Text
- {
- get { return mGraphics.Text; }
- set
- {
- if (IsDispose) return;
- this.mGraphics.Text = value;
- }
- }
- public override CommonUI.Data.TextAnchor Anchor
- {
- get { return mGraphics.Anchor; }
- set { this.mGraphics.Anchor = value; }
- }
- public override Color FontColor
- {
- get { return mGraphics.FontColor; }
- set { mGraphics.FontColor = value; }
- }
- public override Vector2 TextOffset
- {
- get { return mGraphics.TextOffset; }
- set { this.mGraphics.TextOffset = value; }
- }
- public override int FontSize
- {
- get { return 1; }
- set { }
- }
- public override CommonUI.Data.FontStyle Style
- {
- get { return CommonUI.Data.FontStyle.Normal; }
- set { }
- }
- public override bool IsUnderline
- {
- get { return false; }
- set { }
- }
- public override Vector2 PreferredSize
- {
- get { return mGraphics.PreferredSize; }
- }
- public override Rect LastCaretPosition
- {
- get { return mGraphics.LastCaretPosition; }
- }
- public void SetAtlas(CommonUI.Cell.CPJAtlas atlas)
- {
- this.mGraphics.Atlas = atlas;
- }
- protected override void OnUpdate()
- {
- base.OnUpdate();
- }
- public override void SetBorder(Color bc, Vector2 distance)
- {
- //Do nothing.
- }
- public override void SetShadow(Color bc, Vector2 distance)
- {
- }
- public override void SetFont(UnityEngine.Font font)
- {
- }
- }
- }
|