Class SVGImage
A UI image that holds SVG content.
Inheritance
UIBehaviour
Graphic
MaskableGraphic
SVGImage
Implements
ICanvasElement
IClippable
IMaskable
IMaterialModifier
Inherited Members
MaskableGraphic.m_ShouldRecalculateStencil
MaskableGraphic.m_MaskMaterial
MaskableGraphic.onCullStateChanged
MaskableGraphic.maskable
MaskableGraphic.isMaskingGraphic
MaskableGraphic.m_StencilValue
MaskableGraphic.OnEnable()
MaskableGraphic.OnDisable()
MaskableGraphic.OnValidate()
MaskableGraphic.OnTransformParentChanged()
MaskableGraphic.OnCanvasHierarchyChanged()
MaskableGraphic.RecalculateClipping()
MaskableGraphic.RecalculateMasking()
Graphic.s_DefaultUI
Graphic.s_WhiteTexture
Graphic.defaultGraphicMaterial
Graphic.m_Material
Graphic.m_SkipLayoutUpdate
Graphic.m_SkipMaterialUpdate
Graphic.color
Graphic.raycastTarget
Graphic.m_OnDirtyLayoutCallback
Graphic.m_OnDirtyVertsCallback
Graphic.m_OnDirtyMaterialCallback
Graphic.s_Mesh
Graphic.m_CachedMesh
Graphic.m_CachedUvs
Graphic.useLegacyMeshGeneration
Graphic.SetAllDirty()
Graphic.SetLayoutDirty()
Graphic.SetVerticesDirty()
Graphic.SetMaterialDirty()
Graphic.OnRectTransformDimensionsChange()
Graphic.OnBeforeTransformParentChanged()
Graphic.depth
Graphic.rectTransform
Graphic.canvas
Graphic.canvasRenderer
Graphic.defaultMaterial
Graphic.material
Graphic.materialForRendering
Graphic.OnDestroy()
Graphic.OnCullingChanged()
Graphic.Rebuild(CanvasUpdate)
Graphic.LayoutComplete()
Graphic.GraphicUpdateComplete()
Graphic.UpdateMaterial()
Graphic.UpdateGeometry()
Graphic.workerMesh
Graphic.OnRebuildRequested()
Graphic.Reset()
Graphic.OnDidApplyAnimationProperties()
Graphic.SetNativeSize()
Graphic.GetPixelAdjustedRect()
UIBehaviour.Awake()
UIBehaviour.Start()
UIBehaviour.IsActive()
UIBehaviour.OnCanvasGroupChanged()
UIBehaviour.IsDestroyed()
Namespace: Unity.VectorGraphics
Assembly: Unity.VectorGraphics.dll
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
UnityEngine.UI.Graphic.mainTexture
preserveAspect
If true, preserves the aspect ratio of the SVG image.
Declaration
public bool preserveAspect { get; set; }
Property Value
Type | Description |
---|---|
bool |
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
UnityEngine.UI.Graphic.OnPopulateMesh(UnityEngine.UI.VertexHelper)
Implements
UnityEngine.UI.ICanvasElement
UnityEngine.UI.IClippable
UnityEngine.UI.IMaskable
UnityEngine.UI.IMaterialModifier