WebSpriteComponent

Provides a function to output a sprite from the web.

# Properties

[{"index":"List AnimationUrl","0":"Designates several Urls and outputs sprites in order every second. Ignores Url properties and outputs AnimationUrl's sprite if there is one or more sprite Url designated."}]

[{"index":"Color Color (Sync)","0":"Colors the sprite."}]

[{"index":"boolean FlipX (Sync)","0":"Determines whether the sprite is inverted relative to the X axis."}]

[{"index":"boolean FlipY (Sync)","0":"Determines whether the sprite is inverted relative to the Y axis."}]

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Doesn't perform automatic replace when designating the Map Layer name into SortingLayer."}]

[{"index":"string MaterialId (Sync)","0":"Specifies the Id of the material to be applied to the renderer."}]

[{"index":"boolean NeedGizmo (Deprecated) (Sync) (HideFromInspector)","0":"This property is no longer used."}]

[{"index":"Vector2 Offset (Sync)","0":"Provides Offset for the sprite's position."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A greater number indicates higher priority."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more Entities overlap, the priority is determined according to the Sorting Layer."}]

[{"index":"string Url (Sync)","0":"Set up a sprite's Url. Outputs AnimationUrl's sprite if there is one or more sprite Url designated in AnimationUrl."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"void ChangeMaterial(string materialId)","0":"Replaces the material to be applied to the renderer."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# Examples

This is an example of loading an image from the internet and having it gradually fade in.
    
    
    @Component
    script WebSpriteFadeIn extends Component
        property any webSprite = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.webSprite = self.Entity.WebSpriteComponent
    
        self.webSprite.Url = "Http://WebUrl"
    
        -- Sets the initial color to transparent
        self.webSprite.Color = Color(1.0, 1.0, 1.0, 0.0)
        end
    
        @ExecSpace("ClientOnly")
        method void OnUpdate(number delta)
        local alpha = self.webSprite.Color.a
        self.webSprite.Color = Color(1.0, 1.0, 1.0, alpha + delta / 5.0)
        end
    end
    

# SeeAlso

  * Color