Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Layout and texturepacks — Gideros Forum

Layout and texturepacks

Hi, I'm pointing this at @n1cke but maybe someone else have a good idea for a solution:

how to make Layout use texturepacks?

If I try to use a texture from a texturepack with texturepack:getRegion() I get an error
Layout.lua:471: bad argument #1 to 'setTexture' (TextureBase expected, got table)
stack traceback:
libs/Layout.lua:471: in function 'new'

which is the last line in this piece:
function Layout.new(p, d)
	local self = Mesh.new()
	Mesh.setIndexArray(self, 1, 2, 3, 1, 3, 4)
	Mesh.setVertices(self, 1,0,0, 2,0,0, 3,0,0, 4,0,0)
	setmetatable(self, Layout)
 
	self.backup = {}
 
	for k,v in pairs(p) do
		if tonumber(k) then
			self:addChild(self.ext and self:ext(v) or v)
		elseif Layout[k] ~= nil or (d and d[k] ~= nil) then
			self[k] = v
		else
			error("Layout: unknown key `"..tostring(k).."`", 2)
		end
	end
 
	if self.init then self:init(p) end
 
	if self.texture then self:setTexture(self.texture) end
or directly from github:

https://github.com/Nlcke/layout/blob/a79f33de3bce5a35c211d8adae027a6cda382556/Layout.lua#L481

is it because Meshes doesn't support texturepacks? Any workaround?
Thank you

Comments

Sign In or Register to comment.