User:Megamatrixdude/How To Get An Asset's Image: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Megamatrixdude
New page: == How to get an asset's image == Since people on scripting helpers keep asking, I've decided to put this on the wiki. The link to get an asset's image is as follows: http://www.roblox.c...
 
>Megamatrixdude
No edit summary
 
Line 5: Line 5:


http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=230&assetId=ASSET&RAND=123456
http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=230&assetId=ASSET&RAND=123456
You can change the height and width by editing the number after height and width, and change the asset by removing "ASSET" after assetId and pasting a valid asset. If you want a function to do this for you, then here you go (courtesy of Blocco):
{{Example|<pre>
local baseTexture = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=%d&height=%d&assetId=%d";
function GetAssetTexture(aId, w, h)
if aId == nil or type(aId) ~= "number" or (type(aId) == "number" and aId%1 ~= 0) then error("Bad argument #1 to GetAssetTexture (integer expected, got " .. type(aId) .. ")") end
return baseTexture:format(w or 110, h or 110, aId);
end
> GetAssetTexture(1337, 100, 100)
http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=100&height=100&assetId=1337
</pre>}}


Now stop asking.
Now stop asking.


<span style="font-size: 85%;">— [[User:Megamatrixdude|мεgαмαтяιx∂υ∂ε]] <sup>([[User_talk:Megamatrixdude|<span style="color: blue">Talk</span>]] ₪ [[Special:Contributions/Megamatrixdude|<span style="color: green">Contributions</span>]])</sup></span> 20:00, 26 July 2011 (UTC)
<span style="font-size: 85%;">— [[User:Megamatrixdude|мεgαмαтяιx∂υ∂ε]] <sup>([[User_talk:Megamatrixdude|<span style="color: blue">Talk</span>]] ₪ [[Special:Contributions/Megamatrixdude|<span style="color: green">Contributions</span>]])</sup></span> 20:00, 26 July 2011 (UTC)

Latest revision as of 16:06, 30 July 2011

How to get an asset's image

Since people on scripting helpers keep asking, I've decided to put this on the wiki.

The link to get an asset's image is as follows:

http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=230&assetId=ASSET&RAND=123456

You can change the height and width by editing the number after height and width, and change the asset by removing "ASSET" after assetId and pasting a valid asset. If you want a function to do this for you, then here you go (courtesy of Blocco):

Example
local baseTexture = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=%d&height=%d&assetId=%d";
function GetAssetTexture(aId, w, h)
	if aId == nil or type(aId) ~= "number" or (type(aId) == "number" and aId%1 ~= 0) then error("Bad argument #1 to GetAssetTexture (integer expected, got " .. type(aId) .. ")") end
	return baseTexture:format(w or 110, h or 110, aId);
end


> GetAssetTexture(1337, 100, 100)
http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=100&height=100&assetId=1337


Now stop asking.

мεgαмαтяιx∂υ∂ε (TalkContributions) 20:00, 26 July 2011 (UTC)