docs.unity.cn
    Show / Hide Table of Contents

    Class SVGImage

    A UI image that holds SVG content.

    Inheritance
    Object
    UIBehaviour
    Graphic
    MaskableGraphic
    SVGImage
    Inherited Members
    MaskableGraphic.m_ShouldRecalculateStencil
    MaskableGraphic.m_MaskMaterial
    MaskableGraphic.m_IncludeForMasking
    MaskableGraphic.m_ShouldRecalculate
    MaskableGraphic.m_StencilValue
    MaskableGraphic.GetModifiedMaterial(Material)
    MaskableGraphic.Cull(Rect, Boolean)
    MaskableGraphic.SetClipRect(Rect, Boolean)
    MaskableGraphic.SetClipSoftness(Vector2)
    MaskableGraphic.OnEnable()
    MaskableGraphic.OnDisable()
    UnityEngine.UI.MaskableGraphic.OnValidate()
    MaskableGraphic.OnTransformParentChanged()
    MaskableGraphic.ParentMaskStateChanged()
    MaskableGraphic.OnCanvasHierarchyChanged()
    MaskableGraphic.RecalculateClipping()
    MaskableGraphic.RecalculateMasking()
    UnityEngine.UI.MaskableGraphic.UnityEngine.UI.IClippable.get_gameObject()
    MaskableGraphic.onCullStateChanged
    MaskableGraphic.maskable
    MaskableGraphic.isMaskingGraphic
    Graphic.s_DefaultUI
    Graphic.s_WhiteTexture
    Graphic.m_Material
    Graphic.m_SkipLayoutUpdate
    Graphic.m_SkipMaterialUpdate
    Graphic.m_OnDirtyLayoutCallback
    Graphic.m_OnDirtyVertsCallback
    Graphic.m_OnDirtyMaterialCallback
    Graphic.s_Mesh
    Graphic.m_CachedMesh
    Graphic.m_CachedUvs
    Graphic.SetAllDirty()
    Graphic.SetLayoutDirty()
    Graphic.SetVerticesDirty()
    Graphic.SetMaterialDirty()
    Graphic.OnRectTransformDimensionsChange()
    Graphic.OnBeforeTransformParentChanged()
    Graphic.OnDestroy()
    Graphic.OnCullingChanged()
    Graphic.Rebuild(CanvasUpdate)
    Graphic.LayoutComplete()
    Graphic.GraphicUpdateComplete()
    Graphic.UpdateMaterial()
    Graphic.UpdateGeometry()
    Graphic.OnFillVBO(List<UIVertex>)
    Graphic.OnPopulateMesh(Mesh)
    UnityEngine.UI.Graphic.OnRebuildRequested()
    UnityEngine.UI.Graphic.Reset()
    Graphic.OnDidApplyAnimationProperties()
    Graphic.SetNativeSize()
    Graphic.Raycast(Vector2, Camera)
    Graphic.PixelAdjustPoint(Vector2)
    Graphic.GetPixelAdjustedRect()
    Graphic.CrossFadeColor(Color, Single, Boolean, Boolean)
    Graphic.CrossFadeColor(Color, Single, Boolean, Boolean, Boolean)
    Graphic.CrossFadeAlpha(Single, Single, Boolean)
    Graphic.RegisterDirtyLayoutCallback(UnityAction)
    Graphic.UnregisterDirtyLayoutCallback(UnityAction)
    Graphic.RegisterDirtyVerticesCallback(UnityAction)
    Graphic.UnregisterDirtyVerticesCallback(UnityAction)
    Graphic.RegisterDirtyMaterialCallback(UnityAction)
    Graphic.UnregisterDirtyMaterialCallback(UnityAction)
    UnityEngine.UI.Graphic.UnityEngine.UI.ICanvasElement.get_transform()
    Graphic.defaultGraphicMaterial
    Graphic.color
    Graphic.raycastTarget
    Graphic.useLegacyMeshGeneration
    Graphic.depth
    Graphic.rectTransform
    Graphic.canvas
    Graphic.canvasRenderer
    Graphic.defaultMaterial
    Graphic.material
    Graphic.materialForRendering
    Graphic.workerMesh
    UIBehaviour.Awake()
    UIBehaviour.Start()
    UIBehaviour.IsActive()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.IsDestroyed()
    Namespace: Unity.VectorGraphics
    Syntax
    [AddComponentMenu("UI/SVG Image", 11)]
    [MovedFrom("")]
    [RequireComponent(typeof(CanvasRenderer))]
    public class SVGImage : MaskableGraphic, ICanvasElement, IClippable, IMaskable, IMaterialModifier

    Properties

    mainTexture

    The main texture of the SVG image. This will be a white texture for textureless images.

    Declaration
    public override Texture mainTexture { get; }
    Property Value
    Type Description
    Texture
    Overrides
    Graphic.mainTexture

    preserveAspect

    If true, preserves the aspect ratio of the SVG image.

    Declaration
    public bool preserveAspect { get; set; }
    Property Value
    Type Description
    Boolean

    sprite

    The sprite that is used to render this image.

    Declaration
    public Sprite sprite { get; set; }
    Property Value
    Type Description
    Sprite
    Remarks

    This returns the source Sprite of an Image. This Sprite can also be viewed and changed in the Inspector as part of an Image component. This can also be used to change the Sprite using a script.

    Methods

    OnPopulateMesh(VertexHelper)

    Populates the mesh

    Declaration
    protected override void OnPopulateMesh(VertexHelper toFill)
    Parameters
    Type Name Description
    VertexHelper toFill

    The vertices to fill

    Overrides
    Graphic.OnPopulateMesh(VertexHelper)
    Back to top Copyright © 2023 Unity Technologies
    Generated by DocFX
    on Wednesday, April 19, 2023
    Terms of use