Difference between revisions of "How to load a sprite from the web"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "To load a sprite from an image on the web, simply pass the URL to http.get, and assign the result to the sprite's .image property. == Example == <ms>clea...")
 
m
 
Line 1: Line 1:
To load a sprite from an image on the web, simply pass the URL to [[http.get]], and assign the result to the sprite's [[Sprite.image|.image]] property.
+
To load a [[Sprite|sprite]] from an image on the web, simply pass the URL to [[http.get]], and assign the result to the sprite's [[Sprite.image|.image]] property.
  
 
== Example ==
 
== Example ==

Latest revision as of 19:58, 20 November 2021

To load a sprite from an image on the web, simply pass the URL to http.get, and assign the result to the sprite's .image property.

Example

clear
sp = new Sprite
sp.image = http.get("https://miniscript.org/img/Icon.png")
sp.x = 480
sp.y = 320
display(4).sprites.push sp