Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Material Design Icons on Gideros - Gideros Forum

Material Design Icons on Gideros

HubertRonaldHubertRonald Member
edited September 2017 in Step by step tutorials
Hello

I'm checking "Path2D" and I want to show you the next
 
application:setBackgroundColor("0x3A3F3E")
 
pcall(function() require "json" end)
local function load( filename )
	local path = filename..".json"
	local contents			-- will hold contents of file
	local file = io.open( path, "r" ) -- io.open opens a file at path. returns nil if no file found
 
	if file then
		contents = file:read( "*a" ) -- read all contents of file into a string
		io.close( file )		-- close the file after using it
		return json.decode( contents ) -- return Decoded Json string
	else
		return nil	-- or return nil if file didn't ex
	end
 
end
 
local iconsSVG = load("paths")
print("\n",iconsSVG["dice-multiple"])
print(iconsSVG["eye-off"])
print(iconsSVG["account-alert"])
print(iconsSVG["bus-side"])
 
 
local icon = iconsSVG["dice-multiple"]
local p=Path2D.new()
p:setSvgPath(icon) 		
p:setLineThickness(0) 	-- Not Outline
p:setFillColor(0x4D524C)
p:setAnchorPosition(-50,-50)
p:setScale(3)
p:setConvex(false)		-- some icons aren't convex
stage:addChild(p)
Attach file paths.json as zip

If you need a specific icon in paths.json please visit the next page:
https://materialdesignicons.com/

'cos all icons were took of that site web and you must check its name and put it in your code

For more information about how paths.json was generated please check the next link:
https://github.com/HubertRonald/material-design-icons-svg

Enjoy it!

image
zip
zip
paths.json.zip
202K
materialDesignGideros.png
245 x 223 - 6K
+1 -1 (+2 / -0 ) Share on Facebook

Comments

Sign In or Register to comment.